Class JwtParser
java.lang.Object
org.openehealth.ipf.commons.ihe.fhir.audit.auth.JwtParser
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbearerToken(String authenticationHeader) static Optional<com.nimbusds.jwt.JWT> parseAuthenticationToJWT(String authenticationHeader) static Optional<JwtDataSet> parseAuthorizationToJwtDataSet(String authenticationHeader, JwtExtractorProperties jwtExtractorProperties) Reads what the audit record is to say about the access token the request carried.static JwtDataSetparseJwtToBalpDataSet(com.nimbusds.jwt.JWT jwt, JwtClaimsExtractor claimsExtractor, JwtExtractorProperties jwtExtractorProperties)
-
Constructor Details
-
JwtParser
public JwtParser()
-
-
Method Details
-
parseAuthorizationToJwtDataSet
public static Optional<JwtDataSet> parseAuthorizationToJwtDataSet(String authenticationHeader, JwtExtractorProperties jwtExtractorProperties) Reads what the audit record is to say about the access token the request carried.A token that cannot be looked into is not the same as no token at all: it yields
JwtDataSet.opaque(), so that the record can state that a token was presented even though its contents were not visible here. Only a request without a bearer token yields nothing.- Parameters:
authenticationHeader- contents of the Authorization header, may be nulljwtExtractorProperties- where to find the claims- Returns:
- the claims, an opaque marker, or empty if the request carried no bearer token
-
bearerToken
-
parseAuthenticationToJWT
- Parameters:
authenticationHeader- contents of the Authorization header, may be null- Returns:
- the token as a JWT whose claims can be read, or empty when it is not one. An encrypted JWT counts as not one: it parses, but its claims stay sealed without the key, which the audit source does not have -- so it is as opaque here as a reference token.
-
parseJwtToBalpDataSet
public static JwtDataSet parseJwtToBalpDataSet(com.nimbusds.jwt.JWT jwt, JwtClaimsExtractor claimsExtractor, JwtExtractorProperties jwtExtractorProperties)
-