Redirect Parameters
#
Query parameters after login
After a successful login, 36Blocks redirects to your configured redirect URL with the following query parameters:
| Param | Description |
|---|---|
proxy_auth_token |
The session token. See Session & Authorization. |
token_type |
Always Token. |
expire_at |
Unix timestamp of when the session expires. |
user_ref_id |
The logged-in user's id. |
company_ref_id |
The user's current company id. May be absent if the user has no company. |
refresh_token |
Use it to get a new session without a new login. See Refresh Tokens. |
state |
Echoes back whatever state value you passed in on the Authentication widget's config, if any. |
is_new_user |
1 if this login created a new user (a sign-up), 0 otherwise. |
#
Errors on the redirect
If login can't complete, 36Blocks still redirects to your redirect URL, with error (and usually error_description) in the query string instead of a token. Always check for error before reading proxy_auth_token.
For example, when your plan's monthly active user limit has been reached, new users are redirected back with error=mau_limit_reached.
#
Dynamic redirect
By default, a successful login redirects to the Block's configured redirect URL. To redirect somewhere else instead, pass addInfo.redirect_path in the Authentication widget's config:
<script type="text/javascript">
var configuration = {
referenceId: 'YOUR_BLOCK_REFERENCE_ID',
type: 'authorization',
addInfo: {
redirect_path: '/app',
},
success: (data) => {
console.log('success response', data);
},
failure: (error) => {
console.log('failure reason', error);
},
};
</script>