microscopic-answer-24504
03/14/2023, 9:17 AMprehistoric-car-74173
03/14/2023, 9:24 AMsteep-lamp-91158
steep-lamp-91158
steep-lamp-91158
prehistoric-car-74173
03/14/2023, 10:07 AMprehistoric-car-74173
03/14/2023, 10:08 AM```// AuthURL is the authorize url, typically something like: https://example.org/oauth2/auth
// Should only be used when the OAuth2 / OpenID Connect server is not supporting OpenID Connect Discovery and when
//is set toprovider
.generic
AuthURL string `json:"auth_url"````
prehistoric-car-74173
03/14/2023, 10:09 AMcase addProviderName("generic"):
return NewProviderGenericOIDC(&p, reg), nil
steep-lamp-91158
prehistoric-car-74173
03/14/2023, 10:14 AMprehistoric-car-74173
03/14/2023, 10:14 AMprehistoric-car-74173
03/14/2023, 10:15 AMprehistoric-car-74173
03/14/2023, 10:15 AMprehistoric-car-74173
03/14/2023, 10:17 AMdg, err := discordgo.New(fmt.Sprintf("Bearer %s", exchange.AccessToken))
if err != nil {
return nil, errors.WithStack(herodot.ErrInternalServerError.WithReasonf("%s", err))
}
user, err := dg.User("@me")
if err != nil {
return nil, errors.WithStack(herodot.ErrInternalServerError.WithReasonf("%s", err))
}
on second thought, this might be more complicated to implement in a generic way - while the authentication flow is well-defined, the following user information retrieval is entirely up to the providersteep-lamp-91158
prehistoric-car-74173
03/14/2023, 10:41 AMprehistoric-car-74173
03/14/2023, 10:42 AMsteep-lamp-91158
prehistoric-car-74173
03/14/2023, 10:47 AMprehistoric-car-74173
03/14/2023, 10:49 AMprehistoric-car-74173
03/14/2023, 10:56 AM