您在哪里设置identityserver3端点网址?

时间:2015-11-22 21:33:24

标签: identityserver3

identityserver3中端点的URL是否可配置?

如果将权限设置为MVC的示例,

https://localhost:44319/identity

虽然独立的webhost(minimal)示例的授权端点设置为:

https://localhost:44333/connect/authorization

在某处配置了某些内容,以便/ identity可以正常工作。 或者...... /身份根本不是IDSrv3端点,而是API调用而不是

https://localhost:44321/identity 

这是在CallApiController中调用的...(我会将这个例子完全改为其他具有不同名称的东西,以便在应用程序的一部分(Foo和Bar)之间有明显的区别。什么是idsrv3(auth声称令牌和范围)的一部分--sigh。

(问题的结尾......)??

无论如何:

当webhost独立的最小idsrv3关闭时 - 我得到了:

  • 无法建立连接,因为目标计算机主动拒绝了它...我不确定我做错了什么,但确定我做错了什么。 (忘了运行IDSrv3)

  • 当它向上时,在两个路径中:(/ identity和/ connect / authorization)
    我找不到404,

  • 如果我只给root用斜杠,我得到:错误,客户端应用程序未知或未经授权,而不是向我显示登录页面...

所以看起来尾随的斜杠根是正确的方法,这留下了我的第一个问题,所以如何/为什么在MVC演示中设置权限以包含路径/身份。

1 个答案:

答案 0 :(得分:0)

IdentityServer url在startup.cs文件中配置。 在MVC应用程序中,IdS是在' webroot' / identity下配置的。在控制台应用程序中,IdS在自托管的根目录下运行' webroot /'

 app.Map("/identity", idsrvApp =>
            {
                idsrvApp.UseIdentityServer(new IdentityServerOptions
                {
                    SiteName = "Embedded IdentityServer",
                    SigningCertificate = LoadCertificate(),

                    Factory = new IdentityServerServiceFactory()
                                .UseInMemoryUsers(Users.Get())
                                .UseInMemoryClients(Clients.Get())
                                .UseInMemoryScopes(Scopes.Get()),

                    AuthenticationOptions = new IdentityServer3.Core.Configuration.AuthenticationOptions
                    {
                        EnablePostSignOutAutoRedirect = true,
                        IdentityProviders = ConfigureIdentityProviders
                    }
                });
            });

您提到的其他网址都是可以通过发现文档解析的网址:http://' webroot' /.well-known/openid-configuration 或者在MVC应用程序的情况下:http://' webroot' /identity/.well-known/openid-configuration