The provided value for the 'redirect_uri' is not valid.

milosz 123456 101 Reputation points
2021-01-16T16:49:18.463+00:00

I'm trying to get auth token and refresh token after retriving auth code from oauth authorization. I'm getting error that redirect urls must be equal. They are both "http://localhost:23566/auth". This url is also registered in application

57351-obraz.png

OAuth browser url
https://login.live.com/oauth20_authorize.srf?client_id=<id>&response_type=code&redirect_url=http://localhost:23566/auth&scope=XboxLive.signin+offline_access

POST Request:
https://login.live.com/oauth20_token.srf
client_id=<clientID>&client_secret=<secret>&code=<code>&grant_type=authorization_code&redirect_uri=http://localhost:23566/auth

I get error after sending the request

The provided value for the 'redirect_uri' is not valid. The value must exactly match the redirect URI used to obtain the authorization code.

Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
22,065 questions
0 comments No comments
{count} votes

Accepted answer
  1. milosz 123456 101 Reputation points
    2021-01-16T17:41:49.523+00:00

    Oh. I misspeled URL and URI in browser request i did redirect_url and in post redirect_uri. I was not expecting it becouse the first thing worked well.

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.