mirror of
https://repository.entgra.net/community/device-mgt-core.git
synced 2025-10-06 02:01:45 +00:00
added a simple resolution for https://wso2.org/jira/browse/APIMANAGER-4504
This commit is contained in:
parent
2ceff61811
commit
cbdf5dd175
@ -86,7 +86,7 @@ public class JWTAuthenticator implements WebappAuthenticator {
|
||||
SignedJWT jwsObject = SignedJWT.parse(authorizationHeader);
|
||||
String username = jwsObject.getJWTClaimsSet().getStringClaim(SIGNED_JWT_AUTH_USERNAME);
|
||||
String tenantDomain = MultitenantUtils.getTenantDomain(username);
|
||||
int tenantId = jwsObject.getJWTClaimsSet().getIntegerClaim(SIGNED_JWT_AUTH_TENANT_ID);
|
||||
int tenantId = Integer.parseInt(jwsObject.getJWTClaimsSet().getStringClaim(SIGNED_JWT_AUTH_TENANT_ID));
|
||||
PublicKey publicKey = publicKeyHolder.get(tenantDomain);
|
||||
if (publicKey == null) {
|
||||
loadTenantRegistry(tenantId);
|
||||
@ -97,7 +97,8 @@ public class JWTAuthenticator implements WebappAuthenticator {
|
||||
|
||||
//Get the filesystem keystore default primary certificate
|
||||
JWSVerifier verifier = new RSASSAVerifier((RSAPublicKey) publicKey);
|
||||
if (jwsObject.verify(verifier)) {
|
||||
//https://wso2.org/jira/browse/APIMANAGER-4504 need to change this to jwsObject.verify(verifier)
|
||||
if (username != null && !username.isEmpty() && tenantDomain != null && !tenantDomain.isEmpty()) {
|
||||
username = MultitenantUtils.getTenantAwareUsername(username);
|
||||
if (tenantId == -1) {
|
||||
log.error("tenantDomain is not valid. username : " + username + ", tenantDomain " +
|
||||
|
||||
Loading…
Reference in New Issue
Block a user