无效的redirect_uri:http:// localhost:5001 / signin-oidc

时间:2017-09-17 05:35:51

标签: identityserver4

我使用netcoreapp1.1框架开发我的IdentityServer,IdentityServer4版本1.52,使用控制台客户端连接正常,但是使用MVC客户端netcoreapp2.0,记录显示我:

error: IdentityServer4.Validation.AuthorizeRequestValidator [0] Redirect_uri inválido: http://localhost:5001/signin-oidc --code omitted-- error: IdentityServer4.Endpoints.AuthorizeEndpoint [0] Request validation error

我执行了api acces hybrid中的步骤,但我仍然遇到同样的问题,对于我在mvc-hybrid工作的客户端而言,asp.net core 2应用程序没有成功,脱颖而出的是AllowedRedirectUris参数为空。

fail: IdentityServer4.Validation.AuthorizeRequestValidator[0] Invalid redirect_uri: http://localhost:5001/signin-oidc { "ClientId": "client-hugo", "RedirectUri": "http://localhost:5001/signin-oidc", "AllowedRedirectUris": [], "SubjectId": "anonymous", "RequestedScopes": "", "Raw": { "client_id": "client-hugo", "redirect_uri": "http://localhost:5001/signin-oidc", "response_type": "code id_token", "scope": "openid profile email api-alumnos offline_access", "response_mode": "form_post", "nonce": "636412201009966900.ZDNmYjdmZWMtNWNlMS00ZDQyLWIxMjMtNWIzYTM4M2FhZmRhMmMxZGE2ZDUtM2M0MS00ZThiLTk4M2ItNDk2NGQ5YmZlODFj", "state": "CfDJ8J0brcCMivFPtUfbYRpOjISliA92IArZsJS1dmagQ9jYdvpmVj2ABROstPNhJyCWx8q4SntL6PXRubMgGqeUfdqWF0mNRAYifGy8OuEPZSQT295vWVfyN5gGhuvB6jQ043D14yUPLwkhS29IYfMoiliLQGatygTVnGMVJ7Bo-aV7FJcpHit-9b3RHRyaHiE0tToZdP8NxJInJ4vthIlXw1rgLjOmSqPxeN9KDfLgWrpki7XoBLkmV2K7px_GWp0ebaitkxnXTzDPg82M-nRJWfYLAXJ1nGvoZLD3GIXqFV22hDm0wmygbmRaMKezwZmHY12qr2pwa1N22aifJTZFzPY", "x-client-SKU": "ID_NET", "x-client-ver": "2.1.4.0" } } fail: IdentityServer4.Endpoints.AuthorizeEndpoint[0] Request validation failed

你建议我做什么?

3 个答案:

答案 0 :(得分:0)

确保您的mvc客户端在http://localhost:5001

上运行

答案 1 :(得分:0)

我被迫在hosting.json文件中将网址从http://localhost:5001/clientA更改为http://localhost:5001。否则我需要使用UsePathBase中间件来搞乱重定向URL,因为它总是添加每个传入请求的路径。

答案 2 :(得分:0)

如果您使用的是身份服务器4,请检查您的ClientRedirectUris表,检查您的客户是否有权重定向到您的网址。如果没有添加新条目。

下图显示了表格:

ClientRedirectUris created by Identityserver4

相关问题