Package io.micronaut.security.token
Class ClaimsUtils
java.lang.Object
io.micronaut.security.token.ClaimsUtils
Utility class to compare claims.
- Since:
- 4.12.0
- Author:
- Sergio del Amo
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
endsWithIgnoringProtocolAndTrailingSlash
(@NonNull String expectedClaim, @NonNull String claim) For example, for input"https://idcs-214ecfa9143532ca8c3fba0ecb1fe65b.identity.oraclecloud.com"
andidentity.oraclecloud.com
, it returnstrue
.
-
Method Details
-
endsWithIgnoringProtocolAndTrailingSlash
public static boolean endsWithIgnoringProtocolAndTrailingSlash(@NonNull @NonNull String expectedClaim, @NonNull @NonNull String claim) For example, for input"https://idcs-214ecfa9143532ca8c3fba0ecb1fe65b.identity.oraclecloud.com"
andidentity.oraclecloud.com
, it returnstrue
.- Parameters:
expectedClaim
- Expected Claimclaim
- Claim- Returns:
- Whether the expected claim ends with the supplied claim. Both claims are compared without leading protocol and trailing slash.
-