测试gitea将当前项目作为认证源

This commit is contained in:
ShaoHua
2026-01-22 22:33:40 +08:00
parent e0ab9c836c
commit c7a9a267ff
2 changed files with 3 additions and 31 deletions
@@ -113,34 +113,6 @@ public class OpenIddictDataSeedContributor : OpenIddictDataSeedContributorBase,
);
}
// Git Client
var gitClientId = configurationSection["Demo_Git:ClientId"];
if (!gitClientId.IsNullOrWhiteSpace())
{
var gitRootUrl = configurationSection["Demo_Git:RootUrl"]?.TrimEnd('/');
var gitClientSecret = configurationSection["Demo_Git:ClientSecret"];
await CreateOrUpdateApplicationAsync(
applicationType: OpenIddictConstants.ApplicationTypes.Web,
name: gitClientId!,
type: OpenIddictConstants.ClientTypes.Confidential,
consentType: OpenIddictConstants.ConsentTypes.Implicit,
displayName: "Git Application",
secret: gitClientSecret,
grantTypes: new List<string> {
OpenIddictConstants.GrantTypes.AuthorizationCode,
OpenIddictConstants.GrantTypes.RefreshToken
},
scopes: commonScopes,
redirectUris: new List<string> {
$"{gitRootUrl}/users/auth/openid_connect/callback",
$"{gitRootUrl}/user/oauth2/Abp.Demo/callback"
},
postLogoutRedirectUris: new List<string> { $"{gitRootUrl}" },
clientUri: gitRootUrl
);
}
}
}
@@ -11,8 +11,8 @@
"Default": "Host=localhost;Port=5432;Database=Demo;User ID=postgres;Password=123456;"
},
"AuthServer": {
"Authority": "http://192.168.31.2:5000",
"RequireHttpsMetadata": false,
"Authority": "https://localhost:44322",
"RequireHttpsMetadata": true,
"SwaggerClientId": "Demo_Swagger",
"CertificatePassPhrase": "a8dad6bd-08cf-40f9-baaf-873686b50b75"
},
@@ -23,7 +23,7 @@
},
"Demo_Git": {
"ClientId": "Demo_Git",
"ClientSecret": "88077533-3e06-4447-818d-29472e340a6e",
"ClientSecret": "36577533-3e09-4447-818d-29472e340d9f",
"RootUrl": "https://git.we965.cn"
}
},