-
-
Notifications
You must be signed in to change notification settings - Fork 92
Open
Description
Using NewCustomServer how can use MapUserFn?
auth/v2/provider/custom_server.go
Line 49 in 4e32f30
| MapUserFn: defaultMapUserFn, |
Line 33 in 78537e6
| ID: "google_" + token.HashID(sha1.New(), data.Value("sub")), |
My problem using a customServer, i am blocked with an error provider is not allowed.
A custom provider with name provider doesn't create a user.id equal to provider_1234567890
Line 159 in cea049c
| func (a *Authenticator) isProviderAllowed(userID string) bool { |
func newOauth2Provider(
goauth2 *goauth2.Server,
oauth2Config *config.Oauth2,
oauth2loginPageHandler http.HandlerFunc,
oauth2Logger *OAuth2Logger,
) *provider.CustomServer {
serverOption := provider.CustomServerOpt{
URL: oauth2Config.Server,
L: oauth2Logger,
LoginPageHandler: oauth2loginPageHandler,
}
prov := provider.NewCustomServer(goauth2, serverOption)
return prov
}
server.AddCustomProvider("provider", client, oauth2Provider.HandlerOpt)
Maybe i am doing something wrong, but i think is good idea to expose MapUserFn
Maybe related : umputun/remark42#1660 (comment)
Metadata
Metadata
Assignees
Labels
No labels