1

我为我的 Identity Manager 使用以下配置,每次我传递我的访问令牌时 - 它都会抛出 401 (Unauthorized) app.Map("/admin", adminApp => {

        var factory = new IdentityManagerServiceFactory();
        factory.ConfigureSimpleIdentityManagerService("AspId");

        var securityConfig = new ExternalBearerTokenConfiguration
        {
            Issuer = "https://localhost:44333/core",
            Audience = "https://localhost:44333/core/resources",
            Scope = "idmgr",
            SigningCert = Certificate.Get(),
        };

        adminApp.UseIdentityManager(new IdentityManagerOptions()
        {
            Factory = factory,
            SecurityConfiguration = securityConfig
        });
    });

我作为授权持有者传递的访问令牌看起来像

{
"iss": "https://localhost:44333/core",
"aud": "https://localhost:44333/core/resources",
"exp": 1449995870,
"nbf": 1449995510,
"client_id": "roclient",
"scope": [
"email",
"idmgr",
"openid",
"phone",
"profile"
],
"sub": "58067d52-64bf-4447-a928-d3a1316bd677",
"auth_time": 1449995509,
"idp": "idsrv",
"role": [
"admin",
"IdentityManagerAdministrator"
],
"amr": [
"password"
]
}

是我做的不对吗?

4

0 回答 0