class

Comrade::Providers::OAuth2Provider

Inherits Comrade::Providers::BaseProvider < Reference < Object

Base implementation for OAuth 2.0 providers

Instance methods

authorization_url
Source
get_token(code : String, state : String | Nil = nil, code_verifier : String | Nil = nil, **options) : Token

Exchange authorization code for access token

Source
get_user(token : Token) : User

Get user information using access token

Source
redirect(scopes : Array(String) = [] of String, state : String | Nil = nil, code_verifier : String | Nil = nil, **options) : String

Generate authorization URL

Source
refresh_token(refresh_token : String, **options) : Token

Refresh access token

Source
revoke_token(token : String) : Bool

Revoke access token (optional - providers may not support this)

Source
token_url
Source
tokens(code : String, state : String | Nil = nil, **options) : Token

Get access token information

Source
user(code : String, state : String | Nil = nil, **options) : User

Get user information directly from authorization code

Source
user_url
Source