-
-
Notifications
You must be signed in to change notification settings - Fork 564
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
Improve support for integrating with external identity providers (Auth0, IdentityServer, Azure AD etc) #1623
Improve support for integrating with external identity providers (Auth0, IdentityServer, Azure AD etc) #1623
Conversation
As I wrote in my comment in #1622 the solution here is to add your own login page in your application which will then override the embedded version. As much as I appreciate the initiative we will not add more complexity to the architecture by adding a package for a single view of the manager interface. Best regards Håkan |
Hi. I do not have my own Login page. We are implementing https://github.com/AzureAD/microsoft-identity-web for our project. It comes with controllers/login pages OOTB: I do not see the reason why there should be something so opinionated as a classic login/password credential thing as implemented through Anyway, can you please provide guidance on how to incorporate https://www.nuget.org/packages/Microsoft.Identity.Web.ui into a Piranha deployment? |
@tidyui I removed the new project / package. And moved the |
Looking at the
Where the included manager login listens to the following routes:
None of these routes seem to conflict with each other. If you simply want user to use another external login and logout service, wouldn't the simplest solution just be to add a middleware component first in the pipeline that just redirects any requests that comes to |
Some other thoughts on this. Yes, we could move the login/logout pages to a different project as long as we decide on how to handle a couple of things in the manager.
The If it's needed to extract this from the manager (if you don't use the built in login/logout and instead redirect like I mentioned previously there's no need to implement Anything else I'm missing here? |
Adding required complexity by implementing custom middleware components and -not to forget- adding (and DI injecting) some bogus implementation of the |
@tedvanderveen What are your thoughts on my questions (1 & 2) in my previous comment. Would a configurable GET Url be sufficient for your implementation? |
In response to your questions
|
In all, I guess the main objective of this effort is to remove anything related to user account credentials (Login UI bits and anything related to the concept of a "password") out of the |
@tedvanderveen When you get your application up and running, it would be more than awesome if you would contribute an article about it to our docs repo (https://github.com/PiranhaCMS/piranha.core.docs). This is then automatically published to the "Docs" section on our official site. Best regards |
@tidyui got it all tested and working over here. 💹 (using Azure Active Directory B2C, by the way). |
Merged into master with my changes! Will be released on Nuget in version |
This is exciting news! I've been longing to try to integrate with external login. This seems to take things several steps further in that direction. Great job! |
Hey, could you post a gist of what your Startup looks like to get this working? I am trying to use this with Microsoft Identity though they should be similar. |
@AleksandrAlbert I suggest reaching out to @tedvanderveen who was responsible for the change and is using Piranha with external providers. Personally I only use |
@AleksandrAlbert Using Nuget package Microsoft.Identity.Web.UI I have the following setup in startup.cs:
We are using PKCE for signin with B2C, using "single page application" setup. For your scenario you may need to add things like a ClientSecret as well. |
@tedvanderveen Hey Ted, I have the actual MicrosoftIdentity part working from before. I am trying to integrate into an existing application, so trying to figure out how to get Piranha to use the current Login and LogOff endpoints that I have. My Startup looks like this currently:
When I try to go to manager, or to any page with an |
I wanted to follow up on this to say I got the azure login to work by adding some claims for the manager to the identity on authentication. This is what I did, hope it will be of help to someone else in the future: Startup.cs
This allowed me to login to my application using AzureAD, but I was missing the claims needed to login to the manager. To add these, I implemented
Then I just injected this in Startup:
|
When using an external (OAuth etc) identity/auth/token provider, Piranha itself does not handle bits like login (username/password). To better support these scenarios I have moved the interface
ISecurity
and the related Razor pages (Logout and Login) to a separate project. This project can than be added (using the provided extension methods) when needed.Related to issue #1622