使用Postman测试OAuth身份验证代码流

时间:2019-12-11 13:29:31

标签: postman identityserver4

我正在尝试使用Postman测试身份验证代码流-但它似乎无法正常工作。我不确定这是IS4还是邮递员问题。

我使用此处的文档创建了一个新实例:

http://docs.identityserver.io/en/latest/quickstarts/0_overview.html

创建了一个新客户端:

            new Client
            {
                ClientId = "code",

                RedirectUris =
                {
                    "https://www.getpostman.com/oauth2/callback"
                },

                AllowedGrantTypes = GrantTypes.CodeAndClientCredentials,

                 ClientSecrets =
                {
                    new Secret("apisecret".Sha256())
                },

                AllowedScopes = 
                { 
                    IdentityServerConstants.StandardScopes.OpenId,
                    IdentityServerConstants.StandardScopes.Profile,
                    "api1" 
                },

                AllowOfflineAccess = true
            }

然后使用Postman尝试获取ID令牌。

POstman

然后我使用bob / bob或alice / alice登录,当我单击“登录”按钮时,它会重定向回到登录屏幕。

我希望检索访问令牌。

当同时使用SPA客户端针对演示实例(https://demo.identityserver.io/)进行测试时,也会遇到相同的问题。

如果我使用SoapUi,它将起作用。

0 个答案:

没有答案