fix(exampleop): pass the issuer interceptor to login (#430)

* fix(exampleop): pass the issuer interceptor to login

* undo example testing changes
This commit is contained in:
Tim Möhlmann 2023-08-21 07:44:33 +02:00 committed by GitHub
parent 4ed269979e
commit ce85a8b820
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 7 deletions

View file

@ -55,9 +55,10 @@ func SetupServer(issuer string, storage Storage, extraOptions ...op.Option) *mux
log.Fatal(err)
}
// the provider will only take care of the OpenID Protocol, so there must be some sort of UI for the login process
// for the simplicity of the example this means a simple page with username and password field
l := NewLogin(storage, op.AuthCallbackURL(provider))
//the provider will only take care of the OpenID Protocol, so there must be some sort of UI for the login process
//for the simplicity of the example this means a simple page with username and password field
//be sure to provide an IssuerInterceptor with the IssuerFromRequest from the OP so the login can select / and pass it to the storage
l := NewLogin(storage, op.AuthCallbackURL(provider), op.NewIssuerInterceptor(provider.IssuerFromRequest))
// regardless of how many pages / steps there are in the process, the UI must be registered in the router,
// so we will direct all calls to /login to the login UI