Search in sources :

Example 1 with JwtAuthToken

use of org.apache.kerby.kerberos.provider.token.JwtAuthToken in project testcases by coheigea.

the class KerbyHttpAuthSupplier method decorateSubject.

@Override
protected void decorateSubject(Subject subject) {
    KrbRuntime.setTokenProvider(new JwtTokenProvider());
    try {
        JWT jwt = JWTParser.parse(jwtToken);
        AuthToken authToken = new JwtAuthToken(jwt.getJWTClaimsSet());
        KrbToken krbToken = new KrbToken(authToken, TokenFormat.JWT);
        krbToken.setTokenValue(jwtToken.getBytes());
        subject.getPrivateCredentials().add(krbToken);
    } catch (ParseException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
}
Also used : JwtTokenProvider(org.apache.kerby.kerberos.provider.token.JwtTokenProvider) JwtAuthToken(org.apache.kerby.kerberos.provider.token.JwtAuthToken) KrbToken(org.apache.kerby.kerberos.kerb.type.base.KrbToken) JWT(com.nimbusds.jwt.JWT) AuthToken(org.apache.kerby.kerberos.kerb.type.base.AuthToken) JwtAuthToken(org.apache.kerby.kerberos.provider.token.JwtAuthToken) ParseException(java.text.ParseException)

Aggregations

JWT (com.nimbusds.jwt.JWT)1 ParseException (java.text.ParseException)1 AuthToken (org.apache.kerby.kerberos.kerb.type.base.AuthToken)1 KrbToken (org.apache.kerby.kerberos.kerb.type.base.KrbToken)1 JwtAuthToken (org.apache.kerby.kerberos.provider.token.JwtAuthToken)1 JwtTokenProvider (org.apache.kerby.kerberos.provider.token.JwtTokenProvider)1