IdentityServer4 icon indicating copy to clipboard operation
IdentityServer4 copied to clipboard

Getting Invalid Redirect URL / Unauthorized Client

Open Ravivishnubhotla opened this issue 8 years ago • 3 comments

I have an MVC Client .NET 4.5 connecting to IdentityServer4 using Oidc. But I keep getting the following error - Invalid Redirect URL and Unuathorized_client in the login page Everything seems to be correct. Just not sure what the error reason is. Please advise?

Issue / Steps to reproduce the problem

2017-12-28 17:43:47.575 -05:00 [Debug] Start authorize request protocol validation 2017-12-28 17:43:47.916 -05:00 [Debug] "firmplatformlocalhost" found in database: True 2017-12-28 17:43:47.916 -05:00 [Error] Invalid redirect_uri: https://localhost:44300/sigin-oidc "{ "ClientId": "firmplatformlocalhost", "ClientName": "Firm Platform Localhost", "RedirectUri": "https://localhost:44300/sigin-oidc", "AllowedRedirectUris": [ "https://localhost:44300/signin-oidc" ], "SubjectId": "anonymous", "RequestedScopes": "", "Raw": { "client_id": "firmplatformlocalhost", "redirect_uri": "https://localhost:44300/sigin-oidc", "response_mode": "form_post", "response_type": "id_token token", "scope": "openid profile api1", "state": "OpenIdConnect.AuthenticationProperties=8uxqh1Z9FJtfZS_BkJlgZjRV9XC3zQ8Q1fgOmMkmbjBvyohTRoEOB1ixG1j4vbyhU0AOhh5TzesnsWTDrPih2E_BHZpe7prlmC1xLAVBVtk0anvYP-UKy1FRGF0R0bTKWBwEuLf9Q1kdJSh-dFdMqij_MD4oBsimZS1O-QzQh-QJA7DtuhT_9h2b9lYR_FtF0fTboJlt0CKOExCzwmeFQ2sS8ZxCxzl3zG3NVUgl54Q", "nonce": "636500978271625071.ZmMyMjRhNjktYWE2MC00Njc4LTg2MjYtYmE4OTliZTBmYTI5NjA3ZjQ4ZjMtYWFjOS00YWIwLTk2M2ItMTA3OWJmYzQ2YTNh" } }" 2017-12-28 17:43:47.917 -05:00 [Error] Request validation failed 2017-12-28 17:43:47.917 -05:00 [Information] "{ "ClientId": "firmplatformlocalhost", "ClientName": "Firm Platform Localhost", "RedirectUri": "https://localhost:44300/sigin-oidc", "AllowedRedirectUris": [ "https://localhost:44300/signin-oidc" ], "SubjectId": "anonymous", "RequestedScopes": "", "Raw": { "client_id": "firmplatformlocalhost", "redirect_uri": "https://localhost:44300/sigin-oidc", "response_mode": "form_post", "response_type": "id_token token", "scope": "openid profile api1", "state": "OpenIdConnect.AuthenticationProperties=8uxqh1Z9FJtfZS_BkJlgZjRV9XC3zQ8Q1fgOmMkmbjBvyohTRoEOB1ixG1j4vbyhU0AOhh5TzesnsWTDrPih2E_BHZpe7prlmC1xLAVBVtk0anvYP-UKy1FRGF0R0bTKWBwEuLf9Q1kdJSh-dFdMqij_MD4oBsimZS1O-QzQh-QJA7DtuhT_9h2b9lYR_FtF0fTboJlt0CKOExCzwmeFQ2sS8ZxCxzl3zG3NVUgl54Q", "nonce": "636500978271625071.ZmMyMjRhNjktYWE2MC00Njc4LTg2MjYtYmE4OTliZTBmYTI5NjA3ZjQ4ZjMtYWFjOS00YWIwLTk2M2ItMTA3OWJmYzQ2YTNh" } }"

Relevant parts of the log file

<log goes here>

Ravivishnubhotla avatar Dec 28 '17 23:12 Ravivishnubhotla

The redirect uri should be present in the array of AllowedRedirectUris, it is important that this matches exactly. The log outputs:

"RedirectUri": "https://localhost:44300/sigin-oidc\",
"AllowedRedirectUris": [
"https://localhost:44300/signin-oidc"
],

Notice the \ at the end of the redirect uri.

user1336 avatar Dec 29 '17 07:12 user1336

Notice the \ at the end of the redirect uri.

leastprivilege avatar Jan 02 '18 14:01 leastprivilege

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

lock[bot] avatar Jan 13 '20 21:01 lock[bot]