0
私のアプリは、春の雲oauth2を使用しています。oauth2でログイン失敗/成功を聴く方法grant_type =パスワード
私の目標は、ログイン失敗の最大数を制限するために、春のサーバーを使用することです
angular2のログインコード:
const body = "username=" + encodeURI(username) + "&password=" + encodeURI(password) +
"&grant_type=password&client_id=" + encodeURI(this.clientId);
this.http.post("/oauth/token",body,{headers:authHeaders}).map{
...
}
春認証サーバーのWebセキュリティコード:
@Override
protected void configure(HttpSecurity http) throws Exception {
http.httpBasic().and().sessionManagement()
.sessionCreationPolicy(SessionCreationPolicy.STATELESS)
.and().authorizeRequests()
.anyRequest().authenticated();
}
私はこれらの2つのイベントを試します:
public class AuthenticationFailureListener
implements ApplicationListener<AuthenticationFailureBadCredentialsEvent>{
@Override
public void onApplicationEvent(AuthenticationFailureBadCredentialsEvent e) {
//...
}
}
と:
public class AuthenticationSuccessListener
implements ApplicationListener<AuthenticationSuccessEvent> {
@Override
public void onApplicationEvent(AuthenticationSuccessEvent e) {
//...
}
}
しかし、それは "ログインが失敗と成功" 聞く方法
に動作しますか?
私はLDAPに慣れていません... –
LDAP認証は認証マネージャの一例です。メモリー内認証またはjdbc認証を使用できます。 –