/site/login/site/logout/site/signup/site/restore-password/site/change-email/site/change-password/site/resend-verification-email/mfa/totp/enable/mfa/totp/disableReturn URL is used to return user back to an application (main site) after performing needed actions at authorization server, e.g. after logging in or changing password.
Return URL can be provided in two different ways:
redirect_uri parameter provided within OAuth2 Authorization Code Request,
usually used during login procedureback POST or GET request parameter within any request, usually used for
everything besides login, e.g. change email:
https://hiam.hipanel.com/site/change-email?back=https://my.domain.com/some/pageOpenAPI specification is available:
/oauth/authorize/oauth/token/userinfoExample Grafana configuration:
client_id = grafana
client_secret = ***
scopes = email profile
auth_url = https://hiam.hipanel.com/oauth/authorize
token_url = https://hiam.hipanel.com/oauth/token
api_url = https://hiam.hipanel.com/userinfo
Authorization code request uses standard OAuth2 parameters:
client_idredirect_uriresponse_typestatescope, available scopes:emailprofilerolesWhen it is known that users to be sent to authorization are new then
nonempty prefer_signup GET parameter can be added to authorization code request.
Then nonauthorized users will be redirected to signup page instead of login.
Access token request uses standard OAuth2 parameters:
client_idclient_secretredirect_urigrant_typecodeAccess token response provides standard fields:
access_tokenexpires_inrefresh_tokenscopetoken_typeand user_attributes payload:
{
"access_token": "4fb0a78633fd7781b6fb645ed5ba908c1810ee81",
"expires_in": 86400,
"refresh_token": "adb631f49614ea5f1d1c1d704053d16fde7951b8",
"scope": null,
"token_type": "Bearer",
"user_attributes": {
"id": 1234567,
"username": "jsmith",
"email": "john@smith.me",
"email_confirmed": "john@smith.me",
"type": "client",
"state": "ok",
"first_name": "John",
"last_name": "Smith",
"verified": "1"
}
}
User info request must provide HTTP Authorization Bearer header with token.
Example request:
GET https://hiam.hipanel.com/userinfo
Authorization: Bearer be2911ab56ffedf74da3090b0bb1b0a56d07c5b9
Example response for email scope:
{
"email": "sol@hiqdev.com",
"email_confirmed": "sol@hiqdev.com",
"sub": "1000361"
}
sub - user identifier (subject)email - current user emailemail_confirmed - last confirmed user emailemail then the email is confirmedThe authorization server provides all standard grant types:
authorization_codeclient_credentialsrefresh_tokenpasswordimplicitThere is built-in demo where you can try out OAuth2 requests.
Demo is available at /demo page.
Forms are prefetched with reasonable defaults.
Applications can register notification callbacks which will be called on user change events such as user modified, user deleted, user logged out.
Registered callbacks will be called with HTTP POST request with parameters: