Refactored jwt authenticator

This commit is contained in:
mharindu 2016-05-17 08:48:55 +05:30
parent ace6c2dbfc
commit 16a8f61f79
2 changed files with 2 additions and 3 deletions

View File

@ -84,8 +84,7 @@ public class JWTAuthenticator implements WebappAuthenticator {
try {
keyStoreManager.getDefaultPrimaryCertificate();
String authorizationHeader = request.getHeader(JWT_ASSERTION_HEADER);
JWSVerifier verifier =
new RSASSAVerifier((RSAPublicKey) keyStoreManager.getDefaultPublicKey());
JWSVerifier verifier = new RSASSAVerifier((RSAPublicKey) keyStoreManager.getDefaultPublicKey());
SignedJWT jwsObject = SignedJWT.parse(authorizationHeader);
if (jwsObject.verify(verifier)) {
String username = jwsObject.getJWTClaimsSet().getStringClaim(SIGNED_JWT_AUTH_USERNAME);

View File

@ -24,7 +24,7 @@
<WebappPublisherConfigs>
<!-- This host is used to define the host address which is used to publish APIs -->
<Host>https://${carbon.local.ip}:$(carbon.http.port)</Host>
<Host>https://localhost:${carbon.http.port}</Host>
<!-- If it is true, the APIs of this instance will be published to the defined host -->
<PublishAPI>true</PublishAPI>