use of com.sap.cloud.security.xsuaa.token.authentication.XsuaaJwtDecoder in project cloud-security-xsuaa-integration by SAP.
the class SpringXsuaaSecurityContextTest method setToken.
private static void setToken(Token token) {
XsuaaJwtDecoder mockXsuaaJwtDecoder = Mockito.mock(XsuaaJwtDecoder.class);
when(mockXsuaaJwtDecoder.decode(token.getTokenValue())).thenReturn(convertTokenToOAuthJwt(token.getTokenValue()));
// initialize SpringSecurityContext with provided token
init(token.getTokenValue(), mockXsuaaJwtDecoder, new DefaultAuthoritiesExtractor());
}
use of com.sap.cloud.security.xsuaa.token.authentication.XsuaaJwtDecoder in project cloud-security-xsuaa-integration by SAP.
the class SpringSecurityContextTest method initSecurityContextWithToken.
private static void initSecurityContextWithToken(Jwt token) throws InterruptedException {
XsuaaJwtDecoder mockXsuaaJwtDecoder = Mockito.mock(XsuaaJwtDecoder.class);
when(mockXsuaaJwtDecoder.decode(token.getTokenValue())).thenReturn(token);
// initialize SpringSecurityContext with provided token
SpringSecurityContext.init(token.getTokenValue(), mockXsuaaJwtDecoder, new DefaultAuthoritiesExtractor());
}
Aggregations