2017-07-18 59 views
0

这可能是一个非常天真的问题,但由于某些原因,它正在窃听我,因为我必须在我的应用程序中实现与其相关的部分。不要问我为什么。登录登入jhipster

第1步: 我安装了jhipster应用程序,并在我的本地机器上运行它。这本身创建了所有模式和数据库。

第2步: 我使用管理员登录。

问题 代码中的哪一处是关于提及的用户名和密码的检查?这意味着当它击中的数据库和一个特定的用户名获取密码,解密它,它与正在从形式提前

+0

由于您没有提供有关身份验证类型的详细信息,我只能给你一个提示:找一个UserDetailsS​​ervice接口的实现,并详细了解春季Security.Nothing真正具体JHipster在这里。 –

回答

0

提交什么

由于比较我不知道你用什么样的安全模型同时创建该项目。

如果身份验证类型

1:会议

第1步:打开类SecurityConfiguration.java

第2步:在配置方法,你会发现这样的事情。

@Override 
    protected void configure(HttpSecurity http) throws Exception { 
     http 
      .csrf() 
      .csrfTokenRepository(CookieCsrfTokenRepository.withHttpOnlyFalse()) 
     .and() 
      .addFilterBefore(corsFilter, UsernamePasswordAuthenticationFilter.class) 

检查该类

UsernamePasswordAuthenticationFilter.class

你会发现你的答案

2:端Oauth

步骤1:打开文件OAuth2ServerConfiguration .java

第2步:在配置方法,你会发现这样的东西。

@Override 
public void configure(HttpSecurity http) throws Exception { 
    http 
     .exceptionHandling() 
     .authenticationEntryPoint(http401UnauthorizedEntryPoint) 
    .and() 
     .logout() 
     .logoutUrl("/api/logout") 
     .logoutSuccessHandler(ajaxLogoutSuccessHandler) 
    .and() 
     .csrf() 
     .disable() 
     .addFilterBefore(corsFilter, UsernamePasswordAuthenticationFilter.class) 

检查该类

UsernamePasswordAuthenticationFilter.class

所以同一类处理身份验证,编码器被自动调用,因为它是在配置设置。

我希望有帮助。我鼓励你对你的问题更具体。

PS:Jhipster版本:4.3.0