MultiAuth::Provider::GenericOAuth2
Inherits MultiAuth::Provider < Reference < Object
GenericOAuth2 provider allows dynamic OAuth2 provider configuration Use with the factory method for database-driven provider configuration:
MultiAuth.config("my_provider_123") do |provider_name, redirect_uri|
config = load_from_database(provider_name) # Your DB logic
MultiAuth::Provider::GenericOAuth2.new(
provider_name: config.name,
redirect_uri: redirect_uri,
key: config.client_id,
secret: config.client_secret,
site: config.site,
authorize_url: config.authorize_url,
token_url: config.token_url,
authentication_scheme: config.authentication_scheme,
user_profile_url: config.user_profile_url,
scopes: config.scopes,
info_mappings: config.info_mappings
)
end
Constructors
new(redirect_uri : String, key : String, secret : String)
Prevent static configuration - GenericOAuth2 must be used with factory method
new(*, provider_name : String, redirect_uri : String, key : String, secret : String, site : String, authorize_url : String, token_url : String, authentication_scheme : String, user_profile_url : String, scopes : String, info_mappings : Hash(String, String))
SourceInstance methods
authentication_scheme
Sourceauthorize_uri(scope = nil, state = nil)
Sourceauthorize_url
Sourceinfo_mappings
Sourceprovider_name
Sourcescopes
Sourcesite
Sourcetoken_url
Sourceuser(params : Hash(String, String))
Sourceuser_profile_url
Source