1 Respuesta
- Más nuevo
- Más votos
- Más comentarios
0
So the problem was that I tried to set the kid in the "claims" of the JWT.
However it turned out that ,in order for AWS to distinguish that this JWT was signed with this key (from the jwks response), it checks in the headers of the JWT. If a kid is found in the header then it looks in the jwk response for the certificate with the corresponding kid.
So to solve the issue I just had to set the kid of in the "headers" of the JWT.
So if you are in java :
public String buildToken(Key key) {
Map<String, Object> claims = new HashMap();
Map<String, Object> headers = new HashMap();
claims.put(claimName, someClaim);
...
headers.put(KID, KID_OF_THIS_TOKENS_CERTIFICATE);
...
return Jwts.builder().setClaims(claims).setHeader(headers).signWith(SignatureAlgorithm.RS256, key).compact();
}
respondido hace 5 años
Contenido relevante
- Como solucionar el error: Supplied Policy document is breaching Cloudwatch Logs policy length limit.Respuesta aceptadapreguntada hace 16 días
- preguntada hace un mes
- preguntada hace 9 días
- preguntada hace 19 días
- OFICIAL DE AWSActualizada hace 7 meses
- OFICIAL DE AWSActualizada hace 8 meses
- OFICIAL DE AWSActualizada hace un año
- OFICIAL DE AWSActualizada hace 2 años