Implementing web token access in spring boot
In this i tried to implement to render i-frame without login .
Below i've attached my backend code for jwt token generation too.
@Service
public class SisenseTokenService {
// Use the Shared Secret from your Sisense Admin panel
private static final String SHARED_SECRET = "MY_secret_key";
public static String generateSisenseJWT(String userEmail) {
long nowEpoch = Instant.now().getEpochSecond();
return Jwts.builder()
.claim("sub", userEmail) // Sisense user email
.claim("iat", nowEpoch) // Issued At
.claim("jti", UUID.randomUUID().toString()) // Unique token ID
.signWith(SignatureAlgorithm.HS256, SHARED_SECRET.getBytes(StandardCharsets.UTF_8))
.compact();
}
}
output for token:
token:e
decoded:
{
"sub": "platform@cscs.io",
"tenantId": "system",
"iat": ,
"jti": ""
}
in frontend -
<iframe src={`https://sisense-dev.cscs-apps.com/app/main/dashboards/686bca7cef95f60033490c63?embed=true&web_access_token=e`}
width="100%"
height="100%"
/>
still it is not working why? kindly help asap, it is an important blocker
DRay
·1 year agoHi midhun_e,
Do you still need help with this?
midhun_e
OP1 year agoRight now this task is on hold, because the WAT feature is disabled in our license once it is fixed will get back to this. Thanks for the info though.
Assaf Hanina
·1 year agoHey midhun_e ,
Are you trying to implement the Sisense Web Access Token (as mentioned in the title) but the code is for JWT token?
in case the goal is implement Web Access Token (WAT), the 'sub' claim in WAT Is the user id and not the userEmail.
Additionally suggest to raise a support ticket as mentioned by DRay
DRay
·1 year agoHi midhun_e,
Thank you for reaching out. I have removed some content that may have posed a security risk. For this kind of issue we recommend opening a support ticket. They will be able to help with this better than we can here.