SSO Login

Part 1: Get the authorization code

Endpoint

GET: https://rotic.ir/oauth/authorize

Parameters
Status
client_id
required
redirect_url
required
response_type
required
scope
optional
state
required

Responses
Code: 200
Success
response of a correct request
{
    "code": Incoming authorization code,
    "state": State string you sent,
}


                             
Code: 401
401
If you did not send the client id or client secret correctly
{
    "error": "invalid_client",
    "error_description": "Client authentication failed",
    "message": "Client authentication failed"
}

                             
Code: 400
400
If you fill in the scopes by mistake or incorrect
{
    "error": "invalid_scope",
    "error_description": "The requested scope is invalid, unknown, or malformed",
    "hint": "Check the __ scope",
    "message": "The requested scope is invalid, unknown, or malformed"
}
                             

Endpoint

POST: https://rotic.ir/oauth/token

Parameters
Status
grant_type
required
client_id
required
client_secret
required
redirect_uri
required
code
required
Responses
Code: 200
Success
response of a correct request
{
    "token_type": "Bearer",
    "expires_in": Expiration time,
    "access_token": Access token provided by system
}

                             
Code: 401
401
If you did not send the client id or client secret correctly
{
    "error": "invalid_client",
    "error_description": "Client authentication failed",
    "message": "Client authentication failed"
}

                             
Code: 400
400
If you fill in the code by mistake or incorrect
{
    "error":"invalid_request",
    "error_description":"The request is missing a required parameter, includes an invalid parameter",
    "hint": "Check the authorization code",
    "message": "The requested authorization code is invalid, unknown, or malformed"
}