作者:到几百元_309 | 来源:互联网 | 2023-09-14 20:16
Try to test IdentityServer workflow using Volo.Abp.IdentityServer module.
SPA client
MicroserviceDemo->applications->AuthServer.Host
steps:
1.run SPA client
- open cmd ,then run
for restore spa dependency packages.
- type command
for run spa app.
modify SecurityService.js
instead of your auth server .
add client into AuthServer.Host
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
| //vue client
var vueClientId = configurationSection["AuthCenter_Vue:ClientId"];
if (!vueClientId.IsNullOrWhiteSpace())
{
var rootUrl = configurationSection["AuthCenter_Vue:RootUrl"].EnsureEndsWith('/');
await CreateClientAsync(
vueClientId,
commonScopes,
IdentityServer4.Models.GrantTypes.Implicit,
commonSecret,
new[]
{
$"{rootUrl}static/callback.html"
// $"{rootUrl}static/silent-renew.html"
},
$"{rootUrl}index.html",
new[] { rootUrl.RemovePostFix("/") },
setClient: c =>
{
c.AllowAccessTokensViaBrowser = true;
//c.AlwaysIncludeUserClaimsInIdToken = true;
//c.AccessTokenType = (int)IdentityServer4.Models.AccessTokenType.Jwt;
}
);
} |
appsettings.json
1 2 3 4
| "AuthCenter_Vue": {
"ClientId": "vuejsclient",
"RootUrl": "http://localhost:8080/"
} |
issues description:
the auth server host web site was crash, so please check it once, and it's free for communication
该提问来源于开源项目:abpframework/abp
1546