@Test(expected = IllegalArgumentException.class) public void initSecurityContextRaiseExceptionIfNotXsuaaJwtDecoder() { String message = ""; SpringSecurityContext.init(token_1.getTokenValue(), new JwtDecoder() { @Override public Jwt decode(String s) throws JwtException { return token_1; } }, new DefaultAuthoritiesExtractor()); }
static public void init(String encodedJwtToken, JwtDecoder xsuaaJwtDecoder, AuthoritiesExtractor authoritiesExtractor) { Assert.isInstanceOf(XsuaaJwtDecoder.class, xsuaaJwtDecoder, "Passed JwtDecoder instance must be of type 'XsuaaJwtDecoder'"); Jwt jwtToken = xsuaaJwtDecoder.decode(encodedJwtToken); TokenAuthenticationConverter authenticationConverter = new TokenAuthenticationConverter(authoritiesExtractor); Authentication authentication = authenticationConverter.convert(jwtToken); SecurityContextHolder.createEmptyContext(); SecurityContextHolder.getContext().setAuthentication(authentication); }
SpringSecurityContext { static public void init(String encodedJwtToken, JwtDecoder xsuaaJwtDecoder, AuthoritiesExtractor authoritiesExtractor) { Assert.isInstanceOf(XsuaaJwtDecoder.class, xsuaaJwtDecoder, "Passed JwtDecoder instance must be of type 'XsuaaJwtDecoder'"); Jwt jwtToken = xsuaaJwtDecoder.decode(encodedJwtToken); TokenAuthenticationConverter authenticationConverter = new TokenAuthenticationConverter(authoritiesExtractor); Authentication authentication = authenticationConverter.convert(jwtToken); SecurityContextHolder.createEmptyContext(); SecurityContextHolder.getContext().setAuthentication(authentication); } }
SpringSecurityContext { static public void init(String encodedJwtToken, JwtDecoder xsuaaJwtDecoder, AuthoritiesExtractor authoritiesExtractor) { Assert.isInstanceOf(XsuaaJwtDecoder.class, xsuaaJwtDecoder, "Passed JwtDecoder instance must be of type 'XsuaaJwtDecoder'"); Jwt jwtToken = xsuaaJwtDecoder.decode(encodedJwtToken); TokenAuthenticationConverter authenticationConverter = new TokenAuthenticationConverter(authoritiesExtractor); Authentication authentication = authenticationConverter.convert(jwtToken); SecurityContextHolder.createEmptyContext(); SecurityContextHolder.getContext().setAuthentication(authentication); } private  SpringSecurityContext(); }
SpringSecurityContext { static public void init(String encodedJwtToken, JwtDecoder xsuaaJwtDecoder, AuthoritiesExtractor authoritiesExtractor) { Assert.isInstanceOf(XsuaaJwtDecoder.class, xsuaaJwtDecoder, "Passed JwtDecoder instance must be of type 'XsuaaJwtDecoder'"); Jwt jwtToken = xsuaaJwtDecoder.decode(encodedJwtToken); TokenAuthenticationConverter authenticationConverter = new TokenAuthenticationConverter(authoritiesExtractor); Authentication authentication = authenticationConverter.convert(jwtToken); SecurityContextHolder.createEmptyContext(); SecurityContextHolder.getContext().setAuthentication(authentication); } private  SpringSecurityContext(); static Token getToken(); static void init(String encodedJwtToken, JwtDecoder xsuaaJwtDecoder,
			AuthoritiesExtractor authoritiesExtractor); static void clear(); }
SpringSecurityContext { static public void init(String encodedJwtToken, JwtDecoder xsuaaJwtDecoder, AuthoritiesExtractor authoritiesExtractor) { Assert.isInstanceOf(XsuaaJwtDecoder.class, xsuaaJwtDecoder, "Passed JwtDecoder instance must be of type 'XsuaaJwtDecoder'"); Jwt jwtToken = xsuaaJwtDecoder.decode(encodedJwtToken); TokenAuthenticationConverter authenticationConverter = new TokenAuthenticationConverter(authoritiesExtractor); Authentication authentication = authenticationConverter.convert(jwtToken); SecurityContextHolder.createEmptyContext(); SecurityContextHolder.getContext().setAuthentication(authentication); } private  SpringSecurityContext(); static Token getToken(); static void init(String encodedJwtToken, JwtDecoder xsuaaJwtDecoder,
			AuthoritiesExtractor authoritiesExtractor); static void clear();  }