Skip to content

Authentication Service v1.0.0

Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu.

Authentication microservice

Base URLs:

Authentication

  • HTTP Authentication, scheme: bearer

LoginActivityController

LoginActivityController.getActiveUsers

Code samples

const headers = {
  'Accept':'application/json',
  'Authorization':'Bearer {access-token}'
};

fetch('/active-users/{range}',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});
const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'Authorization':'Bearer {access-token}'
};

fetch('/active-users/{range}',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

GET /active-users/{range}

Permissions
ViewLoginActivity

Parameters

Name In Type Required Description
range path string true none
startDate query string(date-time) false none
endDate query string(date-time) false none

Example responses

200 Response

null

Responses

Status Meaning Description Schema
200 OK LoginActivity model instance Inline

Response Schema

LoginActivityController.count

Code samples

const headers = {
  'Accept':'application/json',
  'Authorization':'Bearer {access-token}'
};

fetch('/login-activity/count',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});
const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'Authorization':'Bearer {access-token}'
};

fetch('/login-activity/count',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

GET /login-activity/count

Permissions
ViewLoginActivity

Parameters

Name In Type Required Description
where query object false none

Example responses

200 Response

1
2
3
{
  "count": 0
}

Responses

Status Meaning Description Schema
200 OK LoginActivity model count loopback.Count

LoginActivityController.findById

Code samples

const headers = {
  'Accept':'application/json',
  'Authorization':'Bearer {access-token}'
};

fetch('/login-activity/{id}',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});
const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'Authorization':'Bearer {access-token}'
};

fetch('/login-activity/{id}',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

GET /login-activity/{id}

Permissions
ViewLoginActivity

Parameters

Name In Type Required Description
id path string true none
filter query login_activity.Filter false none

Example responses

200 Response

{
  "id": "string",
  "actor": "string",
  "tenantId": "string",
  "loginTime": "2019-08-24T14:15:22Z",
  "tokenPayload": "string",
  "loginType": "string",
  "deviceInfo": "string",
  "ipAddress": "string"
}

Responses

Status Meaning Description Schema
200 OK LoginActivity model instance LoginActivityWithRelations

LoginActivityController.find

Code samples

const headers = {
  'Accept':'application/json',
  'Authorization':'Bearer {access-token}'
};

fetch('/login-activity',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});
const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'Authorization':'Bearer {access-token}'
};

fetch('/login-activity',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

GET /login-activity

Permissions
ViewLoginActivity

Parameters

Name In Type Required Description
filter query login_activity.Filter false none

Example responses

200 Response

[
  {
    "id": "string",
    "actor": "string",
    "tenantId": "string",
    "loginTime": "2019-08-24T14:15:22Z",
    "tokenPayload": "string",
    "loginType": "string",
    "deviceInfo": "string",
    "ipAddress": "string"
  }
]

Responses

Status Meaning Description Schema
200 OK Array of LoginActivity model instances Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
anonymous [LoginActivityWithRelations] false none [This is to maintain the daily login activity. (tsType: LoginActivityWithRelations, schemaOptions: { includeRelations: true })]
» LoginActivityWithRelations LoginActivityWithRelations false none This is to maintain the daily login activity. (tsType: LoginActivityWithRelations, schemaOptions: { includeRelations: true })
»» id string false none none
»» actor string false none none
»» tenantId string false none none
»» loginTime string(date-time) false none none
»» tokenPayload string false none none
»» loginType string false none none
»» deviceInfo string false none none
»» ipAddress string false none none

AppleLoginController

AppleLoginController.appleCallback

Code samples

const headers = {
  'Accept':'application/json'
};

fetch('/auth/apple-oauth-redirect',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});
const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json'
};

fetch('/auth/apple-oauth-redirect',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

GET /auth/apple-oauth-redirect

Parameters

Name In Type Required Description
code query string false none
state query string false none

Example responses

200 Response

1
2
3
4
5
6
{
  "accessToken": "string",
  "refreshToken": "string",
  "expires": 0,
  "pubnubToken": "string"
}

Responses

Status Meaning Description Schema
200 OK Apple Redirect Token Response TokenResponse

AppleLoginController.postLoginViaApple

Code samples

const inputBody = '{
  "client_id": "string",
  "client_secret": "string"
}';
const headers = {
  'Content-Type':'application/x-www-form-urlencoded'
};

fetch('/auth/oauth-apple',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});
const fetch = require('node-fetch');
const inputBody = {
  "client_id": "string",
  "client_secret": "string"
};
const headers = {
  'Content-Type':'application/x-www-form-urlencoded'
};

fetch('/auth/oauth-apple',
{
  method: 'POST',
  body: JSON.stringify(inputBody),
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

POST /auth/oauth-apple

Body parameter

client_id: string
client_secret: string

Parameters

Name In Type Required Description
body body ClientAuthRequest false none

Example responses

Responses

Status Meaning Description Schema
200 OK POST Call for Apple based login None

Response Schema

AzureLoginController

AzureLoginController.postLoginViaAzure

Code samples

const inputBody = '{
  "client_id": "string",
  "client_secret": "string"
}';
const headers = {
  'Content-Type':'application/x-www-form-urlencoded',
  'Accept':'application/json'
};

fetch('/auth/azure',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});
const fetch = require('node-fetch');
const inputBody = {
  "client_id": "string",
  "client_secret": "string"
};
const headers = {
  'Content-Type':'application/x-www-form-urlencoded',
  'Accept':'application/json'
};

fetch('/auth/azure',
{
  method: 'POST',
  body: JSON.stringify(inputBody),
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

POST /auth/azure

POST Call for azure based login

Body parameter

client_id: string
client_secret: string

Parameters

Name In Type Required Description
body body ClientAuthRequest false none

Example responses

200 Response

1
2
3
4
5
6
{
  "accessToken": "string",
  "refreshToken": "string",
  "expires": 0,
  "pubnubToken": "string"
}

Responses

Status Meaning Description Schema
200 OK Azure Token Response TokenResponse

AzureLoginController.getLoginViaAzure

Code samples

const headers = {
  'Accept':'application/json'
};

fetch('/auth/azure',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});
const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json'
};

fetch('/auth/azure',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

GET /auth/azure

POST Call for azure based login

Parameters

Name In Type Required Description
client_id query string false none
client_secret query string false none

Example responses

200 Response

1
2
3
4
5
6
{
  "accessToken": "string",
  "refreshToken": "string",
  "expires": 0,
  "pubnubToken": "string"
}

Responses

Status Meaning Description Schema
200 OK Azure Token Response TokenResponse

AzureLoginController.azureCallback

Code samples

const headers = {
  'Accept':'application/json'
};

fetch('/auth/azure-oauth-redirect',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});
const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json'
};

fetch('/auth/azure-oauth-redirect',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

GET /auth/azure-oauth-redirect

Parameters

Name In Type Required Description
code query string false none
state query string false none
session_state query string false none

Example responses

200 Response

1
2
3
4
5
6
{
  "accessToken": "string",
  "refreshToken": "string",
  "expires": 0,
  "pubnubToken": "string"
}

Responses

Status Meaning Description Schema
200 OK Azure Redirect Token Response TokenResponse

LoginController

LoginController.resetPassword

Code samples

const inputBody = '{
  "refreshToken": "string",
  "username": "string",
  "password": "string",
  "oldPassword": "string"
}';
const headers = {
  'Content-Type':'application/json',
  'Authorization':'string'
};

fetch('/auth/change-password',
{
  method: 'PATCH',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});
const fetch = require('node-fetch');
const inputBody = {
  "refreshToken": "string",
  "username": "string",
  "password": "string",
  "oldPassword": "string"
};
const headers = {
  'Content-Type':'application/json',
  'Authorization':'string'
};

fetch('/auth/change-password',
{
  method: 'PATCH',
  body: JSON.stringify(inputBody),
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

PATCH /auth/change-password

Body parameter

1
2
3
4
5
6
{
  "refreshToken": "string",
  "username": "string",
  "password": "string",
  "oldPassword": "string"
}

Parameters

Name In Type Required Description
Authorization header string false none
body body ResetPasswordPartial false none

Responses

Status Meaning Description Schema
200 OK If User password successfully changed. None

LoginController.login

Code samples

const inputBody = '{
  "client_id": "string",
  "client_secret": "string",
  "username": "string",
  "password": "string"
}';
const headers = {
  'Content-Type':'application/json'
};

fetch('/auth/login',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});
const fetch = require('node-fetch');
const inputBody = {
  "client_id": "string",
  "client_secret": "string",
  "username": "string",
  "password": "string"
};
const headers = {
  'Content-Type':'application/json'
};

fetch('/auth/login',
{
  method: 'POST',
  body: JSON.stringify(inputBody),
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

POST /auth/login

Gets you the code that will be used for getting token (webapps)

Body parameter

1
2
3
4
5
6
{
  "client_id": "string",
  "client_secret": "string",
  "username": "string",
  "password": "string"
}

Parameters

Name In Type Required Description
body body LoginRequest false none

Example responses

Responses

Status Meaning Description Schema
200 OK Auth Code that you can use to generate access and refresh tokens using the POST /auth/token API None
400 Bad Request The syntax of the request entity is incorrect. None
401 Unauthorized Invalid Credentials. None
404 Not Found The entity requested does not exist. None
422 Unprocessable Entity The syntax of the request entity is incorrect None

Response Schema

LoginController.loginWithClientUser

Code samples

const inputBody = '{
  "client_id": "string",
  "client_secret": "string",
  "username": "string",
  "password": "string"
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json'
};

fetch('/auth/login-token',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});
const fetch = require('node-fetch');
const inputBody = {
  "client_id": "string",
  "client_secret": "string",
  "username": "string",
  "password": "string"
};
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json'
};

fetch('/auth/login-token',
{
  method: 'POST',
  body: JSON.stringify(inputBody),
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

POST /auth/login-token

Gets you refresh token and access token in one hit. (mobile app)

Body parameter

1
2
3
4
5
6
{
  "client_id": "string",
  "client_secret": "string",
  "username": "string",
  "password": "string"
}

Parameters

Name In Type Required Description
body body LoginRequest false none

Example responses

200 Response

1
2
3
4
5
6
{
  "accessToken": "string",
  "refreshToken": "string",
  "expires": 0,
  "pubnubToken": "string"
}

Responses

Status Meaning Description Schema
200 OK Token Response Model TokenResponse
400 Bad Request The syntax of the request entity is incorrect. None
401 Unauthorized Invalid Credentials. None
404 Not Found The entity requested does not exist. None
422 Unprocessable Entity The syntax of the request entity is incorrect None

LoginController.me

Code samples

const headers = {
  'Authorization':'Bearer {access-token}'
};

fetch('/auth/me',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});
const fetch = require('node-fetch');

const headers = {
  'Authorization':'Bearer {access-token}'
};

fetch('/auth/me',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

GET /auth/me

To get the user details

Example responses

Responses

Status Meaning Description Schema
200 OK User Object None
400 Bad Request The syntax of the request entity is incorrect. None
401 Unauthorized Invalid Credentials. None
404 Not Found The entity requested does not exist. None
422 Unprocessable Entity The syntax of the request entity is incorrect None

Response Schema

LoginController.switchToken

Code samples

const inputBody = '{
  "refreshToken": "string",
  "tenantId": "string"
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'Authorization':'Bearer {access-token}'
};

fetch('/auth/switch-token',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});
const fetch = require('node-fetch');
const inputBody = {
  "refreshToken": "string",
  "tenantId": "string"
};
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'Authorization':'Bearer {access-token}'
};

fetch('/auth/switch-token',
{
  method: 'POST',
  body: JSON.stringify(inputBody),
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

POST /auth/switch-token

To switch the access-token

Body parameter

1
2
3
4
{
  "refreshToken": "string",
  "tenantId": "string"
}

Parameters

Name In Type Required Description
body body AuthRefreshTokenRequest false none

Example responses

200 Response

1
2
3
4
5
6
{
  "accessToken": "string",
  "refreshToken": "string",
  "expires": 0,
  "pubnubToken": "string"
}

Responses

Status Meaning Description Schema
200 OK Switch access token with the tenant id provided. TokenResponse
400 Bad Request The syntax of the request entity is incorrect. None
401 Unauthorized Invalid Credentials. None
404 Not Found The entity requested does not exist. None
422 Unprocessable Entity The syntax of the request entity is incorrect None

LoginController.getToken

Code samples

const inputBody = '{
  "code": "string",
  "clientId": "string"
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json'
};

fetch('/auth/token',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});
const fetch = require('node-fetch');
const inputBody = {
  "code": "string",
  "clientId": "string"
};
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json'
};

fetch('/auth/token',
{
  method: 'POST',
  body: JSON.stringify(inputBody),
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

POST /auth/token

Send the code received from the POST /auth/login api and get refresh token and access token (webapps)

Body parameter

1
2
3
4
{
  "code": "string",
  "clientId": "string"
}

Parameters

Name In Type Required Description
body body AuthTokenRequest false none

Example responses

200 Response

1
2
3
4
5
6
{
  "accessToken": "string",
  "refreshToken": "string",
  "expires": 0,
  "pubnubToken": "string"
}

Responses

Status Meaning Description Schema
200 OK Token Response TokenResponse
400 Bad Request The syntax of the request entity is incorrect. None
401 Unauthorized Invalid Credentials. None
404 Not Found The entity requested does not exist. None
422 Unprocessable Entity The syntax of the request entity is incorrect None

LoginController.exchangeToken

Code samples

const inputBody = '{
  "refreshToken": "string",
  "tenantId": "string"
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'device_id':'string',
  'Authorization':'string'
};

fetch('/auth/token-refresh',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});
const fetch = require('node-fetch');
const inputBody = {
  "refreshToken": "string",
  "tenantId": "string"
};
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'device_id':'string',
  'Authorization':'string'
};

fetch('/auth/token-refresh',
{
  method: 'POST',
  body: JSON.stringify(inputBody),
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

POST /auth/token-refresh

Gets you a new access and refresh token once your access token is expired

Body parameter

1
2
3
4
{
  "refreshToken": "string",
  "tenantId": "string"
}

Parameters

Name In Type Required Description
device_id header string false none
Authorization header string false none
body body AuthRefreshTokenRequest false none

Example responses

200 Response

1
2
3
4
5
6
{
  "accessToken": "string",
  "refreshToken": "string",
  "expires": 0,
  "pubnubToken": "string"
}

Responses

Status Meaning Description Schema
200 OK New Token Response TokenResponse
400 Bad Request The syntax of the request entity is incorrect. None
401 Unauthorized Invalid Credentials. None
404 Not Found The entity requested does not exist. None
422 Unprocessable Entity The syntax of the request entity is incorrect None

OtpController

OtpController.checkQr

Code samples

const headers = {
  'code':'string',
  'clientId':'string'
};

fetch('/auth/check-qr-code',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});
const fetch = require('node-fetch');

const headers = {
  'code':'string',
  'clientId':'string'
};

fetch('/auth/check-qr-code',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

GET /auth/check-qr-code

Returns isGenerated:true if secret_key already exist

Parameters

Name In Type Required Description
code header string false none
clientId header string false none

Example responses

Responses

Status Meaning Description Schema
200 OK secret_key already exists None
400 Bad Request The syntax of the request entity is incorrect. None
401 Unauthorized Invalid Credentials. None
404 Not Found The entity requested does not exist. None
422 Unprocessable Entity The syntax of the request entity is incorrect None

Response Schema

OtpController.createQr

Code samples

const inputBody = '{
  "code": "string",
  "clientId": "string"
}';
const headers = {
  'Content-Type':'application/json'
};

fetch('/auth/create-qr-code',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});
const fetch = require('node-fetch');
const inputBody = {
  "code": "string",
  "clientId": "string"
};
const headers = {
  'Content-Type':'application/json'
};

fetch('/auth/create-qr-code',
{
  method: 'POST',
  body: JSON.stringify(inputBody),
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

POST /auth/create-qr-code

Generates a new qrCode for Authenticator App

Body parameter

1
2
3
4
{
  "code": "string",
  "clientId": "string"
}

Parameters

Name In Type Required Description
body body AuthTokenRequest false none

Example responses

Responses

Status Meaning Description Schema
200 OK qrCode that you can use to generate codes in Authenticator App None
400 Bad Request The syntax of the request entity is incorrect. None
401 Unauthorized Invalid Credentials. None
404 Not Found The entity requested does not exist. None
422 Unprocessable Entity The syntax of the request entity is incorrect None

Response Schema

OtpController.sendOtp

Code samples

const inputBody = '{
  "client_id": "string",
  "client_secret": "string",
  "key": "string"
}';
const headers = {
  'Content-Type':'application/json'
};

fetch('/auth/send-otp',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});
const fetch = require('node-fetch');
const inputBody = {
  "client_id": "string",
  "client_secret": "string",
  "key": "string"
};
const headers = {
  'Content-Type':'application/json'
};

fetch('/auth/send-otp',
{
  method: 'POST',
  body: JSON.stringify(inputBody),
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

POST /auth/send-otp

Sends OTP

Body parameter

1
2
3
4
5
{
  "client_id": "string",
  "client_secret": "string",
  "key": "string"
}

Parameters

Name In Type Required Description
body body OtpSendRequest false none

Example responses

Responses

Status Meaning Description Schema
200 OK Sends otp to user None
400 Bad Request The syntax of the request entity is incorrect. None
401 Unauthorized Invalid Credentials. None
404 Not Found The entity requested does not exist. None
422 Unprocessable Entity The syntax of the request entity is incorrect None

Response Schema

OtpController.verifyOtp

Code samples

const inputBody = '{
  "key": "string",
  "otp": "string"
}';
const headers = {
  'Content-Type':'application/json'
};

fetch('/auth/verify-otp',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});
const fetch = require('node-fetch');
const inputBody = {
  "key": "string",
  "otp": "string"
};
const headers = {
  'Content-Type':'application/json'
};

fetch('/auth/verify-otp',
{
  method: 'POST',
  body: JSON.stringify(inputBody),
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

POST /auth/verify-otp

Gets you the code that will be used for getting token (webapps)

Body parameter

1
2
3
4
{
  "key": "string",
  "otp": "string"
}

Parameters

Name In Type Required Description
body body OtpLoginRequest false none

Example responses

Responses

Status Meaning Description Schema
200 OK Auth Code that you can use to generate access and refresh tokens using the POST /auth/token API None
400 Bad Request The syntax of the request entity is incorrect. None
401 Unauthorized Invalid Credentials. None
404 Not Found The entity requested does not exist. None
422 Unprocessable Entity The syntax of the request entity is incorrect None

Response Schema

CognitoLoginController

CognitoLoginController.postLoginViaCognito

Code samples

const inputBody = '{
  "client_id": "string",
  "client_secret": "string"
}';
const headers = {
  'Content-Type':'application/x-www-form-urlencoded',
  'Accept':'application/json'
};

fetch('/auth/cognito',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});
const fetch = require('node-fetch');
const inputBody = {
  "client_id": "string",
  "client_secret": "string"
};
const headers = {
  'Content-Type':'application/x-www-form-urlencoded',
  'Accept':'application/json'
};

fetch('/auth/cognito',
{
  method: 'POST',
  body: JSON.stringify(inputBody),
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

POST /auth/cognito

Body parameter

client_id: string
client_secret: string

Parameters

Name In Type Required Description
body body ClientAuthRequest false none

Example responses

200 Response

1
2
3
4
5
6
{
  "accessToken": "string",
  "refreshToken": "string",
  "expires": 0,
  "pubnubToken": "string"
}

Responses

Status Meaning Description Schema
200 OK POST Call for Cognito based login TokenResponse

CognitoLoginController.loginViaCognito

Code samples

const headers = {
  'Accept':'application/json'
};

fetch('/auth/cognito',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});
const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json'
};

fetch('/auth/cognito',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

GET /auth/cognito

Parameters

Name In Type Required Description
client_id query string false none
client_secret query string false none

Example responses

200 Response

1
2
3
4
5
6
{
  "accessToken": "string",
  "refreshToken": "string",
  "expires": 0,
  "pubnubToken": "string"
}

Responses

Status Meaning Description Schema
200 OK Cognito Token Response (Deprecated: Possible security issue if secret is passed via query params, please use the post endpoint) TokenResponse

CognitoLoginController.cognitoCallback

Code samples

const headers = {
  'Accept':'application/json'
};

fetch('/auth/cognito-auth-redirect',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});
const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json'
};

fetch('/auth/cognito-auth-redirect',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

GET /auth/cognito-auth-redirect

Parameters

Name In Type Required Description
code query string false none
state query string false none

Example responses

200 Response

1
2
3
4
5
6
{
  "accessToken": "string",
  "refreshToken": "string",
  "expires": 0,
  "pubnubToken": "string"
}

Responses

Status Meaning Description Schema
200 OK Cognito Redirect Token Response TokenResponse

FacebookLoginController

FacebookLoginController.postLoginViaFacebook

Code samples

const inputBody = '{
  "client_id": "string",
  "client_secret": "string"
}';
const headers = {
  'Content-Type':'application/x-www-form-urlencoded',
  'Accept':'application/json'
};

fetch('/auth/facebook',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});
const fetch = require('node-fetch');
const inputBody = {
  "client_id": "string",
  "client_secret": "string"
};
const headers = {
  'Content-Type':'application/x-www-form-urlencoded',
  'Accept':'application/json'
};

fetch('/auth/facebook',
{
  method: 'POST',
  body: JSON.stringify(inputBody),
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

POST /auth/facebook

Body parameter

client_id: string
client_secret: string

Parameters

Name In Type Required Description
body body ClientAuthRequest false none

Example responses

200 Response

1
2
3
4
5
6
{
  "accessToken": "string",
  "refreshToken": "string",
  "expires": 0,
  "pubnubToken": "string"
}

Responses

Status Meaning Description Schema
200 OK POST Call for Facebook based login TokenResponse

FacebookLoginController.facebookCallback

Code samples

const headers = {
  'Accept':'application/json'
};

fetch('/auth/facebook-auth-redirect',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});
const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json'
};

fetch('/auth/facebook-auth-redirect',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

GET /auth/facebook-auth-redirect

Parameters

Name In Type Required Description
code query string false none
state query string false none

Example responses

200 Response

1
2
3
4
5
6
{
  "accessToken": "string",
  "refreshToken": "string",
  "expires": 0,
  "pubnubToken": "string"
}

Responses

Status Meaning Description Schema
200 OK Facebook Redirect Token Response TokenResponse

ForgetPasswordController

ForgetPasswordController.forgetPassword

Code samples

const inputBody = '{
  "username": "string",
  "client_id": "string",
  "client_secret": "string"
}';
const headers = {
  'Content-Type':'application/json',
  'Authorization':'Bearer {access-token}'
};

fetch('/auth/forget-password',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});
const fetch = require('node-fetch');
const inputBody = {
  "username": "string",
  "client_id": "string",
  "client_secret": "string"
};
const headers = {
  'Content-Type':'application/json',
  'Authorization':'Bearer {access-token}'
};

fetch('/auth/forget-password',
{
  method: 'POST',
  body: JSON.stringify(inputBody),
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

POST /auth/forget-password

Body parameter

1
2
3
4
5
{
  "username": "string",
  "client_id": "string",
  "client_secret": "string"
}

Parameters

Name In Type Required Description
body body ForgetPasswordDto false none

Responses

Status Meaning Description Schema
204 No Content Success Response. None
400 Bad Request The syntax of the request entity is incorrect. None
401 Unauthorized Invalid Credentials. None
404 Not Found The entity requested does not exist. None
422 Unprocessable Entity The syntax of the request entity is incorrect None

ForgetPasswordController.resetPassword

Code samples

const inputBody = '{
  "token": "string",
  "password": "string",
  "client_id": "string",
  "client_secret": "string"
}';
const headers = {
  'Content-Type':'application/json',
  'Authorization':'Bearer {access-token}'
};

fetch('/auth/reset-password',
{
  method: 'PATCH',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});
const fetch = require('node-fetch');
const inputBody = {
  "token": "string",
  "password": "string",
  "client_id": "string",
  "client_secret": "string"
};
const headers = {
  'Content-Type':'application/json',
  'Authorization':'Bearer {access-token}'
};

fetch('/auth/reset-password',
{
  method: 'PATCH',
  body: JSON.stringify(inputBody),
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

PATCH /auth/reset-password

Body parameter

1
2
3
4
5
6
{
  "token": "string",
  "password": "string",
  "client_id": "string",
  "client_secret": "string"
}

Parameters

Name In Type Required Description
body body ResetPasswordWithClient false none

Responses

Status Meaning Description Schema
204 No Content If User password successfully changed. None

Code samples

fetch('/auth/verify-reset-password-link?token=string',
{
  method: 'GET'

})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});
const fetch = require('node-fetch');

fetch('/auth/verify-reset-password-link?token=string',
{
  method: 'GET'

})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

GET /auth/verify-reset-password-link

Name In Type Required Description
token query string true none
Status Meaning Description Schema
200 OK Check if Token Is Valid and not Expired. None

GoogleLoginController

GoogleLoginController.postLoginViaGoogle

Code samples

const inputBody = '{
  "client_id": "string",
  "client_secret": "string"
}';
const headers = {
  'Content-Type':'application/x-www-form-urlencoded',
  'Accept':'application/json'
};

fetch('/auth/google',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});
const fetch = require('node-fetch');
const inputBody = {
  "client_id": "string",
  "client_secret": "string"
};
const headers = {
  'Content-Type':'application/x-www-form-urlencoded',
  'Accept':'application/json'
};

fetch('/auth/google',
{
  method: 'POST',
  body: JSON.stringify(inputBody),
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

POST /auth/google

Body parameter

client_id: string
client_secret: string

Parameters

Name In Type Required Description
body body ClientAuthRequest false none

Example responses

200 Response

1
2
3
4
5
6
{
  "accessToken": "string",
  "refreshToken": "string",
  "expires": 0,
  "pubnubToken": "string"
}

Responses

Status Meaning Description Schema
200 OK POST Call for Google based login TokenResponse

GoogleLoginController.loginViaGoogle

Code samples

const headers = {
  'Accept':'application/json'
};

fetch('/auth/google',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});
const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json'
};

fetch('/auth/google',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

GET /auth/google

Parameters

Name In Type Required Description
client_id query string false none
client_secret query string false none

Example responses

200 Response

1
2
3
4
5
6
{
  "accessToken": "string",
  "refreshToken": "string",
  "expires": 0,
  "pubnubToken": "string"
}

Responses

Status Meaning Description Schema
200 OK Google Token Response,
(Deprecated: Possible security issue if secret is passed via query params,
please use the post endpoint) TokenResponse

GoogleLoginController.googleCallback

Code samples

const headers = {
  'Accept':'application/json'
};

fetch('/auth/google-auth-redirect',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});
const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json'
};

fetch('/auth/google-auth-redirect',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

GET /auth/google-auth-redirect

Parameters

Name In Type Required Description
code query string false none
state query string false none

Example responses

200 Response

1
2
3
4
5
6
{
  "accessToken": "string",
  "refreshToken": "string",
  "expires": 0,
  "pubnubToken": "string"
}

Responses

Status Meaning Description Schema
200 OK Google Redirect Token Response TokenResponse

InstagramLoginController

InstagramLoginController.postLoginViaInstagram

Code samples

const inputBody = '{
  "client_id": "string",
  "client_secret": "string"
}';
const headers = {
  'Content-Type':'application/x-www-form-urlencoded',
  'Accept':'application/json'
};

fetch('/auth/instagram',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});
const fetch = require('node-fetch');
const inputBody = {
  "client_id": "string",
  "client_secret": "string"
};
const headers = {
  'Content-Type':'application/x-www-form-urlencoded',
  'Accept':'application/json'
};

fetch('/auth/instagram',
{
  method: 'POST',
  body: JSON.stringify(inputBody),
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

POST /auth/instagram

Body parameter

client_id: string
client_secret: string

Parameters

Name In Type Required Description
body body ClientAuthRequest false none

Example responses

200 Response

1
2
3
4
5
6
{
  "accessToken": "string",
  "refreshToken": "string",
  "expires": 0,
  "pubnubToken": "string"
}

Responses

Status Meaning Description Schema
200 OK POST Call for Instagram based login TokenResponse

InstagramLoginController.instagramCallback

Code samples

const headers = {
  'Accept':'application/json'
};

fetch('/auth/instagram-auth-redirect',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});
const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json'
};

fetch('/auth/instagram-auth-redirect',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

GET /auth/instagram-auth-redirect

Parameters

Name In Type Required Description
code query string false none
state query string false none

Example responses

200 Response

1
2
3
4
5
6
{
  "accessToken": "string",
  "refreshToken": "string",
  "expires": 0,
  "pubnubToken": "string"
}

Responses

Status Meaning Description Schema
200 OK Instagram Redirect Token Response TokenResponse

KeycloakLoginController

KeycloakLoginController.postLoginViaKeycloak

Code samples

const inputBody = '{
  "client_id": "string",
  "client_secret": "string"
}';
const headers = {
  'Content-Type':'application/x-www-form-urlencoded',
  'Accept':'application/json'
};

fetch('/auth/keycloak',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});
const fetch = require('node-fetch');
const inputBody = {
  "client_id": "string",
  "client_secret": "string"
};
const headers = {
  'Content-Type':'application/x-www-form-urlencoded',
  'Accept':'application/json'
};

fetch('/auth/keycloak',
{
  method: 'POST',
  body: JSON.stringify(inputBody),
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

POST /auth/keycloak

POST Call for keycloak based login

Body parameter

client_id: string
client_secret: string

Parameters

Name In Type Required Description
body body ClientAuthRequest false none

Example responses

200 Response

1
2
3
4
5
6
{
  "accessToken": "string",
  "refreshToken": "string",
  "expires": 0,
  "pubnubToken": "string"
}

Responses

Status Meaning Description Schema
200 OK Keycloak Token Response TokenResponse

KeycloakLoginController.loginViaKeycloak

Code samples

const headers = {
  'Accept':'application/json'
};

fetch('/auth/keycloak',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});
const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json'
};

fetch('/auth/keycloak',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

GET /auth/keycloak

Parameters

Name In Type Required Description
client_id query string false none
client_secret query string false none

Example responses

200 Response

1
2
3
4
5
6
{
  "accessToken": "string",
  "refreshToken": "string",
  "expires": 0,
  "pubnubToken": "string"
}

Responses

Status Meaning Description Schema
200 OK Keycloak Token Response TokenResponse

KeycloakLoginController.keycloakCallback

Code samples

const headers = {
  'Accept':'application/json'
};

fetch('/auth/keycloak-auth-redirect',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});
const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json'
};

fetch('/auth/keycloak-auth-redirect',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

GET /auth/keycloak-auth-redirect

Parameters

Name In Type Required Description
code query string false none
state query string false none

Example responses

200 Response

1
2
3
4
5
6
{
  "accessToken": "string",
  "refreshToken": "string",
  "expires": 0,
  "pubnubToken": "string"
}

Responses

Status Meaning Description Schema
200 OK Keycloak Redirect Token Response TokenResponse

SamlLoginController

SamlLoginController.postLoginViaSaml

Code samples

const inputBody = '{
  "client_id": "string",
  "client_secret": "string"
}';
const headers = {
  'Content-Type':'application/x-www-form-urlencoded',
  'Accept':'application/json'
};

fetch('/auth/saml',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});
const fetch = require('node-fetch');
const inputBody = {
  "client_id": "string",
  "client_secret": "string"
};
const headers = {
  'Content-Type':'application/x-www-form-urlencoded',
  'Accept':'application/json'
};

fetch('/auth/saml',
{
  method: 'POST',
  body: JSON.stringify(inputBody),
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

POST /auth/saml

POST Call for saml based login

Body parameter

client_id: string
client_secret: string

Parameters

Name In Type Required Description
body body ClientAuthRequest false none

Example responses

200 Response

1
2
3
4
5
6
{
  "accessToken": "string",
  "refreshToken": "string",
  "expires": 0,
  "pubnubToken": "string"
}

Responses

Status Meaning Description Schema
200 OK Saml Token Response TokenResponse

SamlLoginController.oktaSamlCallback

Code samples

const inputBody = '{}';
const headers = {
  'Content-Type':'application/x-www-form-urlencoded',
  'Accept':'application/json'
};

fetch('/auth/saml-redirect',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});
const fetch = require('node-fetch');
const inputBody = {};
const headers = {
  'Content-Type':'application/x-www-form-urlencoded',
  'Accept':'application/json'
};

fetch('/auth/saml-redirect',
{
  method: 'POST',
  body: JSON.stringify(inputBody),
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

POST /auth/saml-redirect

Body parameter

{}

Parameters

Name In Type Required Description
client query string false none
body body object false none

Example responses

200 Response

1
2
3
4
5
6
{
  "accessToken": "string",
  "refreshToken": "string",
  "expires": 0,
  "pubnubToken": "string"
}

Responses

Status Meaning Description Schema
200 OK okta auth callback TokenResponse

SignupRequestController

SignupRequestController.requestSignup

Code samples

const inputBody = '{
  "email": "string",
  "data": {}
}';
const headers = {
  'Content-Type':'application/json'
};

fetch('/auth/sign-up/create-token',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});
const fetch = require('node-fetch');
const inputBody = {
  "email": "string",
  "data": {}
};
const headers = {
  'Content-Type':'application/json'
};

fetch('/auth/sign-up/create-token',
{
  method: 'POST',
  body: JSON.stringify(inputBody),
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

POST /auth/sign-up/create-token

Body parameter

1
2
3
4
{
  "email": "string",
  "data": {}
}

Parameters

Name In Type Required Description
body body SignupRequestDto false none

Responses

Status Meaning Description Schema
204 No Content Sucess Response. None
400 Bad Request The syntax of the request entity is incorrect. None
401 Unauthorized Invalid Credentials. None
404 Not Found The entity requested does not exist. None
422 Unprocessable Entity The syntax of the request entity is incorrect None

SignupRequestController.signupWithToken

Code samples

const inputBody = '{
  "email": "string",
  "password": "string"
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'Authorization':'Bearer {access-token}'
};

fetch('/auth/sign-up/create-user',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});
const fetch = require('node-fetch');
const inputBody = {
  "email": "string",
  "password": "string"
};
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'Authorization':'Bearer {access-token}'
};

fetch('/auth/sign-up/create-user',
{
  method: 'POST',
  body: JSON.stringify(inputBody),
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

POST /auth/sign-up/create-user

Body parameter

1
2
3
4
{
  "email": "string",
  "password": "string"
}

Parameters

Name In Type Required Description
body body LocalUserProfileDto false none

Example responses

200 Response

1
2
3
4
{
  "email": "string",
  "password": "string"
}

Responses

Status Meaning Description Schema
200 OK Sucess Response. LocalUserProfileDto
400 Bad Request The syntax of the request entity is incorrect. None
401 Unauthorized Invalid Credentials. None
404 Not Found The entity requested does not exist. None
422 Unprocessable Entity The syntax of the request entity is incorrect None

SignupRequestController.verifyInviteToken

Code samples

const headers = {
  'Authorization':'Bearer {access-token}'
};

fetch('/auth/sign-up/verify-token',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});
const fetch = require('node-fetch');

const headers = {
  'Authorization':'Bearer {access-token}'
};

fetch('/auth/sign-up/verify-token',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

GET /auth/sign-up/verify-token

Responses

Status Meaning Description Schema
200 OK Sucess Response. None
400 Bad Request The syntax of the request entity is incorrect. None
401 Unauthorized Invalid Credentials. None
404 Not Found The entity requested does not exist. None
422 Unprocessable Entity The syntax of the request entity is incorrect None

LogoutController

LogoutController.googleLogout

Code samples

const inputBody = '{
  "refreshToken": "string"
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'Authorization':'string'
};

fetch('/google/logout',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});
const fetch = require('node-fetch');
const inputBody = {
  "refreshToken": "string"
};
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'Authorization':'string'
};

fetch('/google/logout',
{
  method: 'POST',
  body: JSON.stringify(inputBody),
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

POST /google/logout

This API will log out the user from application as well as google

Body parameter

1
2
3
{
  "refreshToken": "string"
}

Parameters

Name In Type Required Description
Authorization header string false This is the access token which is required to authenticate user.
body body RefreshTokenRequestPartial false none

Example responses

200 Response

1
2
3
{
  "success": true
}

Responses

Status Meaning Description Schema
200 OK Success Response SuccessResponse
400 Bad Request The syntax of the request entity is incorrect. None
401 Unauthorized Invalid Credentials. None
404 Not Found The entity requested does not exist. None
422 Unprocessable Entity The syntax of the request entity is incorrect None

LogoutController.keycloakLogout

Code samples

const inputBody = '{
  "refreshToken": "string"
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'Authorization':'string'
};

fetch('/keycloak/logout',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});
const fetch = require('node-fetch');
const inputBody = {
  "refreshToken": "string"
};
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'Authorization':'string'
};

fetch('/keycloak/logout',
{
  method: 'POST',
  body: JSON.stringify(inputBody),
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

POST /keycloak/logout

This API will log out the user from application as well as keycloak

Body parameter

1
2
3
{
  "refreshToken": "string"
}

Parameters

Name In Type Required Description
Authorization header string false This is the access token which is required to authenticate user.
body body RefreshTokenRequestPartial false none

Example responses

200 Response

1
2
3
{
  "success": true
}

Responses

Status Meaning Description Schema
200 OK Success Response SuccessResponse
400 Bad Request The syntax of the request entity is incorrect. None
401 Unauthorized Invalid Credentials. None
404 Not Found The entity requested does not exist. None
422 Unprocessable Entity The syntax of the request entity is incorrect None

LogoutController.logout

Code samples

const inputBody = '{
  "refreshToken": "string"
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'Authorization':'string'
};

fetch('/logout',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});
const fetch = require('node-fetch');
const inputBody = {
  "refreshToken": "string"
};
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'Authorization':'string'
};

fetch('/logout',
{
  method: 'POST',
  body: JSON.stringify(inputBody),
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

POST /logout

To logout

Body parameter

1
2
3
{
  "refreshToken": "string"
}

Parameters

Name In Type Required Description
Authorization header string false This is the access token which is required to authenticate user.
body body RefreshTokenRequestPartial false none

Example responses

200 Response

1
2
3
{
  "success": true
}

Responses

Status Meaning Description Schema
200 OK Success Response SuccessResponse
400 Bad Request The syntax of the request entity is incorrect. None
401 Unauthorized Invalid Credentials. None
404 Not Found The entity requested does not exist. None
422 Unprocessable Entity The syntax of the request entity is incorrect None

Schemas

LoginRequest

1
2
3
4
5
6
{
  "client_id": "string",
  "client_secret": "string",
  "username": "string",
  "password": "string"
}

LoginRequest

Properties

Name Type Required Restrictions Description
client_id string true none This property is supposed to be a string and is a required field
client_secret string false none This property is supposed to be a string and is a required field
username string true none This property is supposed to be a string and is a required field
password string true none This property is supposed to be a string and is a required field

TokenResponse

1
2
3
4
5
6
{
  "accessToken": "string",
  "refreshToken": "string",
  "expires": 0,
  "pubnubToken": "string"
}

TokenResponse

Properties

Name Type Required Restrictions Description
accessToken string true none This property is supposed to be a string and is a required field
refreshToken string true none This property is supposed to be a string and is a required field
expires number true none none
pubnubToken string false none none

AuthTokenRequest

1
2
3
4
{
  "code": "string",
  "clientId": "string"
}

AuthTokenRequest

Properties

Name Type Required Restrictions Description
code string true none none
clientId string true none none

Function

null

Properties

None

AuthRefreshTokenRequest

1
2
3
4
{
  "refreshToken": "string",
  "tenantId": "string"
}

AuthRefreshTokenRequest

Properties

Name Type Required Restrictions Description
refreshToken string true none none
tenantId string false none none

ResetPasswordPartial

1
2
3
4
5
6
{
  "refreshToken": "string",
  "username": "string",
  "password": "string",
  "oldPassword": "string"
}

ResetPasswordPartial

Properties

Name Type Required Restrictions Description
refreshToken string false none none
username string false none This property is supposed to be a string and is a required field
password string false none This property is supposed to be a string and is a required field
oldPassword string false none This property is supposed to be a string and is a required field

ResetPassword

1
2
3
4
5
6
{
  "refreshToken": "string",
  "username": "string",
  "password": "string",
  "oldPassword": "string"
}

ResetPassword

Properties

Name Type Required Restrictions Description
refreshToken string true none none
username string true none This property is supposed to be a string and is a required field
password string true none This property is supposed to be a string and is a required field
oldPassword string false none This property is supposed to be a string and is a required field

ClientAuthRequest

1
2
3
4
{
  "client_id": "string",
  "client_secret": "string"
}

ClientAuthRequest

Properties

Name Type Required Restrictions Description
client_id string true none This property is supposed to be a string and is a required field
client_secret string true none This property is supposed to be a string and is a required field

SuccessResponse

1
2
3
{
  "success": true
}

SuccessResponse

Properties

Name Type Required Restrictions Description
success boolean false none none

RefreshTokenRequestPartial

1
2
3
{
  "refreshToken": "string"
}

RefreshTokenRequestPartial

Properties

Name Type Required Restrictions Description
refreshToken string false none none

RefreshTokenRequest

1
2
3
{
  "refreshToken": "string"
}

RefreshTokenRequest

Properties

Name Type Required Restrictions Description
refreshToken string true none none

OtpSendRequest

1
2
3
4
5
{
  "client_id": "string",
  "client_secret": "string",
  "key": "string"
}

OtpSendRequest

Properties

Name Type Required Restrictions Description
client_id string true none This property is supposed to be a string and is a required field
client_secret string true none This property is supposed to be a string and is a required field
key string true none This property is supposed to be a string and is a required field

OtpLoginRequest

1
2
3
4
{
  "key": "string",
  "otp": "string"
}

OtpLoginRequest

Properties

Name Type Required Restrictions Description
key string true none This property is supposed to be a string and is a required field
otp string true none This property is supposed to be a string and is a required field

ForgetPasswordDto

1
2
3
4
5
{
  "username": "string",
  "client_id": "string",
  "client_secret": "string"
}

ForgetPasswordDto

Properties

Name Type Required Restrictions Description
username string true none none
client_id string true none none
client_secret string true none none

AuthClient

{
  "deleted": true,
  "deletedOn": "2019-08-24T14:15:22Z",
  "deletedBy": "string",
  "createdOn": "2019-08-24T14:15:22Z",
  "modifiedOn": "2019-08-24T14:15:22Z",
  "createdBy": "string",
  "modifiedBy": "string",
  "id": 0,
  "clientId": "string",
  "clientSecret": "string",
  "secret": "string",
  "redirectUrl": "string",
  "accessTokenExpiration": 0,
  "refreshTokenExpiration": 0,
  "authCodeExpiration": 0
}

AuthClient

Properties

Name Type Required Restrictions Description
deleted boolean false none none
deletedOn string(date-time)¦null false none none
deletedBy string¦null false none none
createdOn string(date-time) false none none
modifiedOn string(date-time) false none none
createdBy string false none none
modifiedBy string false none none
id number false none none
clientId string true none none
clientSecret string true none none
secret string true none Value can be a string or a private key.
redirectUrl string false none none
accessTokenExpiration number true none none
refreshTokenExpiration number true none none
authCodeExpiration number true none none

ResetPasswordWithClient

1
2
3
4
5
6
{
  "token": "string",
  "password": "string",
  "client_id": "string",
  "client_secret": "string"
}

ResetPasswordWithClient

Properties

Name Type Required Restrictions Description
token string true none none
password string true none none
client_id string true none none
client_secret string true none none

SignupRequestDto

1
2
3
4
{
  "email": "string",
  "data": {}
}

SignupRequestDto

Properties

Name Type Required Restrictions Description
email string true none none
data object false none none

LocalUserProfileDto

1
2
3
4
{
  "email": "string",
  "password": "string"
}

LocalUserProfileDto

Properties

Name Type Required Restrictions Description
email string true none none
password string true none none

SignupRequest

1
2
3
4
{
  "email": "string",
  "expiry": "string"
}

SignupRequest

Properties

Name Type Required Restrictions Description
email string true none none
expiry string false none none

LoginActivityWithRelations

{
  "id": "string",
  "actor": "string",
  "tenantId": "string",
  "loginTime": "2019-08-24T14:15:22Z",
  "tokenPayload": "string",
  "loginType": "string",
  "deviceInfo": "string",
  "ipAddress": "string"
}

LoginActivityWithRelations

Properties

Name Type Required Restrictions Description
id string false none none
actor string false none none
tenantId string false none none
loginTime string(date-time) false none none
tokenPayload string false none none
loginType string false none none
deviceInfo string false none none
ipAddress string false none none

Date

null

Properties

None

loopback.Count

1
2
3
{
  "count": 0
}

loopback.Count

Properties

Name Type Required Restrictions Description
count number false none none

login_activity.Filter

{
  "offset": 0,
  "limit": 100,
  "skip": 0,
  "order": "string",
  "where": {},
  "fields": {
    "id": true,
    "actor": true,
    "tenantId": true,
    "loginTime": true,
    "tokenPayload": true,
    "loginType": true,
    "deviceInfo": true,
    "ipAddress": true
  }
}

login_activity.Filter

Properties

Name Type Required Restrictions Description
offset integer false none none
limit integer false none none
skip integer false none none
order any false none none

oneOf

Name Type Required Restrictions Description
» anonymous string false none none

xor

Name Type Required Restrictions Description
» anonymous [string] false none none

continued

Name Type Required Restrictions Description
where object false none none
fields any false none none

oneOf

Name Type Required Restrictions Description
» anonymous object false none none
»» id boolean false none none
»» actor boolean false none none
»» tenantId boolean false none none
»» loginTime boolean false none none
»» tokenPayload boolean false none none
»» loginType boolean false none none
»» deviceInfo boolean false none none
»» ipAddress boolean false none none

xor

Name Type Required Restrictions Description
» anonymous [string] false none none