-
Notifications
You must be signed in to change notification settings - Fork 210
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
This should not try to configure 'everything' especially setting Cookie Authentication #809
Comments
I'm happy to create a PR for this |
@Shazwazza Yes, you could provide an experimental PR so that we understand your proposed design. We'd like to avoid breaking changes if possible, and also we want simples scenarios to remain simple, and complex ones to be possible. On the other hand if you have very advanced needs, and know what you are doing, you might not even need to use AddMicrosoftIdentityWebApp. you could iinitialize OpenIdConnect yourself? (with What is your scenario? |
@Shazwazza do you mind trying this branch, which does offers the possibility of not defining the cookie scheme, if you do something like this: services.AddAuthentication().AddMicrosoftIdentityWebApp(Configuration, cookieScheme: null); cc: @jmprieur |
Hi thanks for the replies. @jennyf19 that branch you mention would be fine to have the possibility of passing in null instead of something fake, and then people can use post configure options to tweak any OpenIdConnect options created 👍 @jmprieur initializing OpenIdConnect manually for Azure AD (and b2c) is something I'd like to avoid where possible since it's quite a lot of code to maintain. It's something I previously had to do before netcore which ended up being a bit of a 'moving target'. I guess what might be ideal is to have public method that registers these
We're building the netcore version of the Umbraco CMS and just like in the versions previous to netcore we have the ability for people to install and configure external login providers for the back office. All of the auth is pre-configured in Umbraco so the external logins are just extensions to the auth that is already there. |
Thanks @Shazwazza
passing null to which parameter, @Shazwazza ? In that branch you can pass null to the cookieScheme. For which other parameter would you like to pass-in null? |
Sorry I should have been more clear, what @jennyf19 mentioned with this code in that branch: services.AddAuthentication().AddMicrosoftIdentityWebApp(Configuration, cookieScheme: null); Allowing passing null for |
thanks for the quick reply and confirmation @Shazwazza we'll have this fix out this week in 1.4. |
Included in 1.4 Release. |
Which version of Microsoft Identity Web are you using?
1.3.0
Where is the issue?
It's not possible to disable this library from adding cookie authentication which is problematic if you already have it. This library seems to be trying to do 'everything' which I understand can mean simplicity for some users but it reduces the flexibility. The work around for now is to pass in a "Fake" cookie scheme that doesn't exist, else you will get exceptions if you pass in an existing one since it already exists.
It would be nice to split this method up with additional public methods for more flexibility. See here
microsoft-identity-web/src/Microsoft.Identity.Web/WebAppExtensions/MicrosoftIdentityWebAppAuthenticationBuilderExtensions.cs
Line 238 in c75ea22
microsoft-identity-web/src/Microsoft.Identity.Web/WebAppExtensions/MicrosoftIdentityWebAppAuthenticationBuilderExtensions.cs
Line 254 in c75ea22
Is this a new or an existing app?
c. This is a new app or an experiment.
Expected behavior
Be able to add/configure the openidconnect options without configuring a bunch of unwanted or already existing services.
Actual behavior
There is not an option to do this
The text was updated successfully, but these errors were encountered: