Coder Social home page Coder Social logo

Error from RemoteAuthentication: Message contains error: 'redirect_uri_mismatch', error_description: 'AADB2C90006: The redirect URI 'http://b2.95e4700435c54427a457.northeurope.aksapp.io/signin-oidc' provided in the request is not registered for the client id 'eb201049-e7b1-4227-9a7c-5bb259261d37'. Correlation ID: 8f75359e-009f-44e3-b537-3f85f58cdd9c about active-directory-b2c-dotnetcore-webapp HOT 6 CLOSED

digeler avatar digeler commented on June 24, 2024 1
Error from RemoteAuthentication: Message contains error: 'redirect_uri_mismatch', error_description: 'AADB2C90006: The redirect URI 'http://b2.95e4700435c54427a457.northeurope.aksapp.io/signin-oidc' provided in the request is not registered for the client id 'eb201049-e7b1-4227-9a7c-5bb259261d37'. Correlation ID: 8f75359e-009f-44e3-b537-3f85f58cdd9c

from active-directory-b2c-dotnetcore-webapp.

Comments (6)

DanoThom avatar DanoThom commented on June 24, 2024 1

Works locally, but unfortunately this does not work for me when I publish to production. I'm still getting the issue where the redirect URL is using http under the hood instead of https and hence doesn't match my https app redirect configuration.

image

image

Even if I hard code the string in the OnRedirectToIdentityProvider delegate it doesn't appear to be taking it into account.

Ideas? This seems to be a prevalent and very annoying black box type bug. Still no reply from the MS team.

from active-directory-b2c-dotnetcore-webapp.

elvogel avatar elvogel commented on June 24, 2024

I'm getting this same error in ASP.NET Core 2.2 when deploying into App Engine.

from active-directory-b2c-dotnetcore-webapp.

elvogel avatar elvogel commented on June 24, 2024

I found a fix for this and will be issuing a pull request. If for some reason the PR is declined, add this to the top of OnRedirectToIdentityProvider in OpenIdConnectOptionsSetup:

if (context.ProtocolMessage.RedirectUri.Contains("http:"))
{                    
    context.ProtocolMessage.RedirectUri = context.ProtocolMessage.RedirectUri.Replace("http:", "https:");
}

from active-directory-b2c-dotnetcore-webapp.

TheReaLee avatar TheReaLee commented on June 24, 2024

@elvogel Your solution worked for us. Thanks

from active-directory-b2c-dotnetcore-webapp.

elvogel avatar elvogel commented on June 24, 2024

In the months since I posted this, the libraries have upgraded and this has become a moot point, as the current libraries have greatly simplified a good deal of this plumbing.

That being said - can you confirm that you're hitting this OnRedirectToIdentityProvider event?

from active-directory-b2c-dotnetcore-webapp.

jmprieur avatar jmprieur commented on June 24, 2024

Closing this issue as this sample is being archived and replaced by a newer ASP.NET Core 3.1 sample.
See Readme.md

from active-directory-b2c-dotnetcore-webapp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.