This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
eyJraWQiOiJvYXV0aDJrZXlwYWlyIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJ3ZWJsb2dpYyIsImlzcyI6Ind3dy5vcmFjbGUuY29tIiwiZXhwIjoxNTQwNDY2NDI4LCJpYXQiOjE1NDA0NjU4Mjh9.ZE8wMnFyjHcmFpdswgx3H8azVCPtHkrRjqhiKt-qZaV1Y5YlN9jAOshUnPIQ76L8K4SAduhJg7MyLQsAipzCFeT_Omxnxu0lgbD2UYtz-TUIt23bjcsJLub5pNrLXJWL3k7tSdkcVxlyHuRPYCvoLhLZzCksqnRdD6Zf9VjxGLFPktknXwpn7_aOAdzXEatj-Gd9lm321R2BdFL7ii9sXh9A1KL8cblLbhLlrXGwTF_ifTxuHSBz1B_p6xng6kmOfIwDIAJQ9t6KESQm8dQQeilcny1uRmhg4o85uc4gGzhH435q1DRuHQm22wN39FHbNT4WP3EuoZ49PpsTeQzSKA |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"sub":"weblogic","iss":"www.oracle.com","exp":1540466428,"iat":1540465828} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -u tokenuser:Welcome01 -X POST -d "grant_type=client_credentials" http://localhost:7101/oauth2/resources/tokenservice |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<grant> | |
<grantee> | |
<codesource> | |
<url>file:${domain.home}/servers/${weblogic.Name}/tmp/_WL_user/oauth2/-</url> | |
</codesource> | |
</grantee> | |
<permissions> | |
<permission> | |
<class>oracle.security.jps.service.keystore.KeyStoreAccessPermission</class> | |
<name>stripeName=owsm,keystoreName=keystore,alias=*</name> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AccessController.doPrivileged(new PrivilegedAction<String>() { | |
public String run() { | |
try { | |
JpsContext ctx = JpsContextFactory.getContextFactory().getContext(); | |
KeyStoreService kss = ctx.getServiceInstance(KeyStoreService.class); | |
ks = kss.getKeyStore(prop.getProperty("keystorestripe"), prop.getProperty("keystorename"), null); | |
} catch (Exception e) { | |
return "error"; | |
} | |
return "done"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PasswordProtection pp = new PasswordProtection(prop.getProperty("keypassword").toCharArray()); | |
KeyStore.PrivateKeyEntry pkEntry = (KeyStore.PrivateKeyEntry) ks.getEntry(prop.getProperty("keyalias"), pp); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RSAPrivateKey myPrivateKey = (RSAPrivateKey) pkEntry.getPrivateKey(); | |
RSAPublicKey myPublicKey = (RSAPublicKey) pkEntry.getCertificate().getPublicKey(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RSAKey rsaJWK = new RSAKey.Builder(myPublicKey).privateKey(myPrivateKey).keyID(prop.getProperty("keyalias")).build(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
JWSSigner signer = new RSASSASigner(rsaJWK); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
JWTClaimsSet claimsSet = new JWTClaimsSet.Builder() | |
.subject(user) | |
.issuer(prop.getProperty("tokenissuer")) | |
.expirationTime(expires) | |
.issueTime(new Date(new Date().getTime())) | |
.build(); |
OlderNewer