Giter Club home page Giter Club logo

Comments (4)

scottbrady91 avatar scottbrady91 commented on May 29, 2024

Hi Ryan,

Just to clarify, you are trying to log into IdentityServer using an external OpenID provider?

If so, when IdentityServer uses ASP.NET Identity, it needs to use the ASP.NET Identity external cookie scheme, not the IdentityServer version. You also do not need to register a cookie using the cookie middleware.

So your code would something like the following:

var openIdList = new[]
{
    new
    {
        DisplayName = "ptgadspike.onmicrosoft.com",
        ClientId = "17d673f4-c719-48a8-98ff-714556d5e13a",
        TenantId = "edb8aeb7-8177-4665-91e8-b528abdcdf33",
        SchemaName = "spike1",
    },
    new
    {
        DisplayName = "ptgadspike2.onmicrosoft.com",
        ClientId = "61a59626-a872-4de0-bd8a-7c507e015d78",
        TenantId = "24a9b864-f468-4f88-bf94-3e60941ce1f5",
        SchemaName = "spike2",
     },
};

openIdList.ToList().ForEach(item =>
{
    app.UseOpenIdConnectAuthentication(new OpenIdConnectOptions
    {
        AuthenticationScheme = item.SchemaName,
        DisplayName = item.DisplayName,
        SignInScheme = "Identity.External",
        ClientId = item.ClientId,
        Authority = $"https://login.microsoftonline.com/{item.TenantId}",
        ResponseType = OpenIdConnectResponseType.IdToken,
        SignedOutCallbackPath = $"/signedout-oidc/{item.SchemaName}",
        CallbackPath = $"/signin-oidc/{item.SchemaName}"
    });
});

Let me know how it goes.

from samples.identityserver.adminuiintegration.

ryandanthony avatar ryandanthony commented on May 29, 2024

I am trying to use it as a federation gateway:
http://docs.identityserver.io/en/release/topics/federation_gateway.html

This is the user flow:
screen1
screen2
screen3
screen4
screen5

*see notes on the screen shots.

from samples.identityserver.adminuiintegration.

ryandanthony avatar ryandanthony commented on May 29, 2024

Oh, forgot to mention, I did try changing the SignInScheme to "Identity.External".
But it didn't work. Same result (see screen shots above).

from samples.identityserver.adminuiintegration.

scottbrady91 avatar scottbrady91 commented on May 29, 2024

If you have app.UseIdentity() and your external providers have SignInScheme = "Identity.External", then this should be working. Maybe check the ordering of you IApplicationBuilder registrations.

It should look something like this:

app.UseIdentity();
app.UseIdentityServer();

app.UseOpenIdConnectAuthentication(...);

app.UseStaticFiles();
app.UseMvcWithDefaultRoute();

from samples.identityserver.adminuiintegration.

Related Issues (7)

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.