@Test(expected = IllegalStateException.class) public void testOidcNotEnabledGetJwt() throws Exception { final OidcService service = getServiceWithNoOidcSupport(); service.getJwt(TEST_REQUEST_IDENTIFIER); }
public String getJwt(final String oidcRequestIdentifier) { if (!isOidcEnabled()) { throw new IllegalStateException(OPEN_ID_CONNECT_SUPPORT_IS_NOT_CONFIGURED); } final CacheKey oidcRequestIdentifierKey = new CacheKey(oidcRequestIdentifier); synchronized (jwtLookupForCompletedRequests) { final String jwt = jwtLookupForCompletedRequests.getIfPresent(oidcRequestIdentifierKey); if (jwt != null) { jwtLookupForCompletedRequests.invalidate(oidcRequestIdentifierKey); } return jwt; } }
OidcService { public String getJwt(final String oidcRequestIdentifier) { if (!isOidcEnabled()) { throw new IllegalStateException(OPEN_ID_CONNECT_SUPPORT_IS_NOT_CONFIGURED); } final CacheKey oidcRequestIdentifierKey = new CacheKey(oidcRequestIdentifier); synchronized (jwtLookupForCompletedRequests) { final String jwt = jwtLookupForCompletedRequests.getIfPresent(oidcRequestIdentifierKey); if (jwt != null) { jwtLookupForCompletedRequests.invalidate(oidcRequestIdentifierKey); } return jwt; } } }
OidcService { public String getJwt(final String oidcRequestIdentifier) { if (!isOidcEnabled()) { throw new IllegalStateException(OPEN_ID_CONNECT_SUPPORT_IS_NOT_CONFIGURED); } final CacheKey oidcRequestIdentifierKey = new CacheKey(oidcRequestIdentifier); synchronized (jwtLookupForCompletedRequests) { final String jwt = jwtLookupForCompletedRequests.getIfPresent(oidcRequestIdentifierKey); if (jwt != null) { jwtLookupForCompletedRequests.invalidate(oidcRequestIdentifierKey); } return jwt; } } OidcService(final OidcIdentityProvider identityProvider);  OidcService(final OidcIdentityProvider identityProvider, final int duration, final TimeUnit units); }
OidcService { public String getJwt(final String oidcRequestIdentifier) { if (!isOidcEnabled()) { throw new IllegalStateException(OPEN_ID_CONNECT_SUPPORT_IS_NOT_CONFIGURED); } final CacheKey oidcRequestIdentifierKey = new CacheKey(oidcRequestIdentifier); synchronized (jwtLookupForCompletedRequests) { final String jwt = jwtLookupForCompletedRequests.getIfPresent(oidcRequestIdentifierKey); if (jwt != null) { jwtLookupForCompletedRequests.invalidate(oidcRequestIdentifierKey); } return jwt; } } OidcService(final OidcIdentityProvider identityProvider);  OidcService(final OidcIdentityProvider identityProvider, final int duration, final TimeUnit units); boolean isOidcEnabled(); URI getAuthorizationEndpoint(); URI getEndSessionEndpoint(); Scope getScope(); String getClientId(); State createState(final String oidcRequestIdentifier); boolean isStateValid(final String oidcRequestIdentifier, final State proposedState); RefreshToken exchangeAuthorizationCode(final String oidcRequestIdentifier, final AuthorizationGrant authorizationGrant); String getJwtFromOIDCTokens(OIDCTokens oidcTokens); OIDCTokens exchangeOIDCToken(AuthorizationGrant authorizationGrant); OIDCTokenResponse exchangeOIDCToken(RefreshToken refreshToken); String getJwt(final String oidcRequestIdentifier); }
OidcService { public String getJwt(final String oidcRequestIdentifier) { if (!isOidcEnabled()) { throw new IllegalStateException(OPEN_ID_CONNECT_SUPPORT_IS_NOT_CONFIGURED); } final CacheKey oidcRequestIdentifierKey = new CacheKey(oidcRequestIdentifier); synchronized (jwtLookupForCompletedRequests) { final String jwt = jwtLookupForCompletedRequests.getIfPresent(oidcRequestIdentifierKey); if (jwt != null) { jwtLookupForCompletedRequests.invalidate(oidcRequestIdentifierKey); } return jwt; } } OidcService(final OidcIdentityProvider identityProvider);  OidcService(final OidcIdentityProvider identityProvider, final int duration, final TimeUnit units); boolean isOidcEnabled(); URI getAuthorizationEndpoint(); URI getEndSessionEndpoint(); Scope getScope(); String getClientId(); State createState(final String oidcRequestIdentifier); boolean isStateValid(final String oidcRequestIdentifier, final State proposedState); RefreshToken exchangeAuthorizationCode(final String oidcRequestIdentifier, final AuthorizationGrant authorizationGrant); String getJwtFromOIDCTokens(OIDCTokens oidcTokens); OIDCTokens exchangeOIDCToken(AuthorizationGrant authorizationGrant); OIDCTokenResponse exchangeOIDCToken(RefreshToken refreshToken); String getJwt(final String oidcRequestIdentifier);  }