Generate JWT Token

Hello,
I’m trying to generate the JWT Token to authenticate get the Access Token for making requests but i’m having some trouble to follow the instructions:

if (appSettings != null) { if (appSettings.getBusinessId() != null) { claimsSet.setCustomClaim(Claims.POYNT_BIZ, appSettings.getBusinessId().toString()); } if (appSettings.getStoreId() != null) { claimsSet.setCustomClaim(Claims.POYNT_STORE, appSettings.getStoreId().toString()); } if (appSettings.getStoreDeviceId() != null) { claimsSet.setCustomClaim(Claims.POYNT_DEVICE_ID, deviceMetaData.getStoreDeviceId()); } } if (Strings.notEmpty(issuedTo)) { claimsSet.setCustomClaim(Claims.POYNT_ISSUED_TO, issuedTo); }

I can’t find these Constants anywhere, Claims.POYNT_BIZ, Claims.POYNT_STORE, Claims.POYNT_DEVICE_ID… where can i find them?
Can you please help me?
Regards

Hello,

Claims.java is a constants file. Here’s the list of the claims:

public static final String POYNT_API_SERVER = "https://services.poynt.net";
public static final String ISSUER = "iss";
public static final String SUBJECT = "sub";
public static final String AUDIENCE = "aud";
public static final String EXPIRATION_TIME = "exp";
public static final String NOT_BEFORE = "nbf";
public static final String ISSUED_AT = "iat";
public static final String JWT_ID = "jti";
public static final String TYPE = "typ";
public static final String POYNT_BIZ = "poynt.biz";
public static final String POYNT_ORG = "poynt.org";
public static final String POYNT_STORE = "poynt.str";
public static final String POYNT_DEVICE_ID = "poynt.did";
public static final String POYNT_USER_ROLE = "poynt.ure";
public static final String POYNT_USER_ID = "poynt.uid";
public static final String POYNT_SUBJECT_CRED_TYPE = "poynt.sct";
public static final String POYNT_SUBJECT_CRED_VALUE = "poynt.scv";
public static final String POYNT_SUBJECT_CRED_LAST_UPDATE = "poynt.scu";
public static final String POYNT_APPLICATION_URN = "poynt.aur";
public static final String POYNT_ISSUER_KEY_ID = "poynt.kid";
public static final String POYNT_ISSUED_TO = "poynt.ist";

It appears Claims.java is not in our SDK. I will check if we can add that.

Thank you dennis :slight_smile: I’ve already managed to get the access token, saw on your python sample :slight_smile: