Skip to content
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

OpenId connect authorization_code #46

Open
nearlyheadlessarvie opened this issue Apr 17, 2024 · 4 comments
Open

OpenId connect authorization_code #46

nearlyheadlessarvie opened this issue Apr 17, 2024 · 4 comments
Labels
question Further information is requested

Comments

@nearlyheadlessarvie
Copy link

This is more of a question than an issue:

Is it possible to complete an openid connect authorization_code flow? I tried it but getting 404 in /signin-oidc.

@artmasa
Copy link
Contributor

artmasa commented Apr 17, 2024

Hi @nearlyheadlessarvie,
If you want to execute authentication flows, I think you will need to create your own Authentication middleware replicating ASPNET Cores one, but using the Azure Functions middleware interface. All ASP.NET interfaces you see in ASPNET middleware should be already registered in your services when you called AddAuthentication(...).AddOpenIdConnect(...) so it should be pretty straight forward.

Can you show your setup?

I think is a great idea to add this functionality to this package.

@artmasa artmasa added the question Further information is requested label Apr 17, 2024
@artmasa
Copy link
Contributor

artmasa commented Apr 17, 2024

Also, something to consider is that in the Isolated model, there are 2 processes, Host and your functions. The host process relays request to your functions process using GRPC.
If the function URL does not exist on the host it will never make it to your functions process.
You will have to fake the remote authentication URLs (/signin-oidc, etc...) as http triggered functions, even when they will never be hit as the authentication middleware is the one handling those requests.

@artmasa
Copy link
Contributor

artmasa commented Apr 17, 2024

@nearlyheadlessarvie, here is a quick implementation for remote authentication using a middleware.
I'm looking into dynamically adding support for remote authentication callbacks based on the options and add the related functions methods

@nearlyheadlessarvie
Copy link
Author

At the moment there's no real need to hook on any events so it's very basic
image

Btw, its like the moment you read my question there's this idea you had and executed it real quick... and it worked!

You just forgot the await

var handler = handlers.GetHandlerAsync(httpContext, scheme.Name) as IAuthenticationRequestHandler;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants