Skip to main content

Authentication Service V2

A token is a piece of data that has no meaning or use on its own, but combined with the correct tokenization system, becomes a vital player in securing your application. Token based authentication works by ensuring that each request to a server is accompanied by a signed token (RFC 7519) that defines a compact and self-contained method for securely transmitting information between parties encoded as a JSON object.

The Authentication V2 API enables you to manage all aspects of user identity. It offers endpoints so your users can log in, sign up, log out, access APIs, and more.

note

Your access-token contains many privileges, keep it secure!

APIs


Connect With Authorization Code

API to complete OAuth connection with code and get tokens

Parameters

  • authCode String

Returns

Code

  @Autowired
private OAuthV2Client oAuthV2Client;

public OAuthV2AccessToken connect(String authCode) {
return this.oAuthV2Client.connectWithDeskera(authCode);
}

Validate Deskera Access Token

API to check the validity of Deskera Access Token

Parameters

  • accessToken String

Returns

  • isValid Boolean

Code

  @Autowired
private OAuthV2Client oAuthV2Client;

public Boolean validateDeskeraToken(String accessToken) {
return this.oAuthV2Client.validateToken(accessToken);
}

Refresh Deskera Access Token

API to fetch new access token with refresh token

Parameters

  • refreshToken String

Returns

Code

  @Autowired
private OAuthV2Client oAuthV2Client;

public OAuthV2AccessToken refreshDeskeraToken(String refreshToken) {
return this.oAuthV2Client.getAppRefreshToken(refreshToken);
}

Objects


AuthenticationResultTypeDto

AttributeTypeDescription
accessTokenstring
expiresIninteger
idTokenstring
newDeviceMetadataNewDeviceMetadataType
refreshTokenstring
tokenTypestring

NewDeviceMetadataType

AttributeTypeDescription
deviceGroupKeystring
deviceKeystring

OAuthV2AccessToken

AttributeTypeDescription
access_tokenstringAuth token
token_typestringToken Type
refresh_tokenstringAuth refresh token
expires_infloatTime of expiry (Unused)