Documentation ¶
Index ¶
Constants ¶
View Source
const ( // URL_AUTHORIZATION used to request an authorization URL_AUTHORIZATION = "/oauth2/authorize" // URL_ACCESS_TOKEN used to get a new access token URL_ACCESS_TOKEN = "/oauth2/access_token" // URL_USER_INFO used to retrieve current user information URL_USER_INFO = "/oauth2/user_info/" // URL_REDIRECT used as parameters when requesting an authorization as redirect uri URL_REDIRECT = "/complete/edx-oidc/" )
Variables ¶
This section is empty.
Functions ¶
func RandomToken ¶
RandomToken generate a random string that will be used as state
Types ¶
type Backend ¶
type Backend struct {
// contains filtered or unexported fields
}
Backend is the main part of auth_backend. It stores oauth2.Config, app and edx url configuration
func (*Backend) Authenticate ¶
Authenticate is callback handler when receiving redirection from edx site after successfully login
func (*Backend) GetAuthorizationURL ¶
GetAuthorizationURL return authentication url based on given state
type UserInfo ¶
type UserInfo struct { TrackingID uint `json:"user_tracking_id"` Email string `json:"email"` FamilyName string `json:"family_name"` GivenName string `json:"given_name"` Locale string `json:"locale"` Name string `json:"name'` Username string `json:"preferred_username"` Sub string `json:"sub"` }
UserInfo stored user information from user endpoint edx
Click to show internal directories.
Click to hide internal directories.