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": "[email protected]",
"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
Right 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.