io.github.jhipster.registry.security.jwt.TokenProvider Java Examples

The following examples show how to use io.github.jhipster.registry.security.jwt.TokenProvider. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: JWTSecurityConfiguration.java    From flair-registry with Apache License 2.0 5 votes vote down vote up
public JWTSecurityConfiguration(@Value("${spring.security.user.name}") String username,
                                @Value("${spring.security.user.password}") String password,
                                @Value("${spring.security.user.roles}") String[] roles,
                                AuthenticationManagerBuilder authenticationManagerBuilder,
                                Http401UnauthorizedEntryPoint authenticationEntryPoint,
                                TokenProvider tokenProvider) {
    this.username = username;
    this.password = password;
    this.roles = roles;
    this.authenticationManagerBuilder = authenticationManagerBuilder;
    this.authenticationEntryPoint = authenticationEntryPoint;
    this.tokenProvider = tokenProvider;
}
 
Example #2
Source File: UserJWTControllerTest.java    From flair-registry with Apache License 2.0 5 votes vote down vote up
@Before
public void setup() {
    tokenProvider = Mockito.mock(TokenProvider.class);

    UserJWTController control = new UserJWTController(tokenProvider, authenticationManager);
    this.mock = MockMvcBuilders.standaloneSetup(control).build();
}
 
Example #3
Source File: UserJWTControllerTest.java    From jhipster-microservices-example with Apache License 2.0 5 votes vote down vote up
@Before
public void setup() {
    tokenProvider = Mockito.mock(TokenProvider.class);
    authenticationManager = Mockito.mock(AuthenticationManager.class);

    UserJWTController control = new UserJWTController(tokenProvider, authenticationManager);
    this.mock = MockMvcBuilders.standaloneSetup(control).build();
}
 
Example #4
Source File: UserJWTController.java    From flair-registry with Apache License 2.0 4 votes vote down vote up
public UserJWTController(TokenProvider tokenProvider, AuthenticationManager authenticationManager) {
    this.tokenProvider = tokenProvider;
    this.authenticationManager = authenticationManager;
}
 
Example #5
Source File: UserJWTController.java    From jhipster-microservices-example with Apache License 2.0 4 votes vote down vote up
public UserJWTController(TokenProvider tokenProvider, AuthenticationManager authenticationManager) {
    this.tokenProvider = tokenProvider;
    this.authenticationManager = authenticationManager;
}
 
Example #6
Source File: SecurityConfiguration.java    From jhipster-microservices-example with Apache License 2.0 4 votes vote down vote up
public SecurityConfiguration(Http401UnauthorizedEntryPoint authenticationEntryPoint,
                             TokenProvider tokenProvider) {
    this.authenticationEntryPoint = authenticationEntryPoint;
    this.tokenProvider = tokenProvider;
}
 
Example #7
Source File: UserJWTController.java    From jhipster-registry with Apache License 2.0 4 votes vote down vote up
public UserJWTController(TokenProvider tokenProvider, AuthenticationManagerBuilder authenticationManagerBuilder) {
    this.tokenProvider = tokenProvider;
    this.authenticationManagerBuilder = authenticationManagerBuilder;
}
 
Example #8
Source File: JWTSecurityConfiguration.java    From jhipster-registry with Apache License 2.0 4 votes vote down vote up
@Bean
public TokenProvider tokenProvider() {
    return new TokenProvider(jHipsterProperties);
}