Похожие чаты

@Override public String getPassword() { //

TODO Auto-generated method stub
return this.password;
} while returning the password i want to return password2 also . means user can login with any of those password can anyone tell me the solution?

2 ответов

18 просмотров

Long story short, you can't do that with UserDetails + UserDetailsService. These classes are not mandatory, but rather are an out-of-the-box mechanism for username+password authentication. And obviously it's designed for classic username + single password use-case. For other types of authentication (which includes your case with 2 alternative passwords too) you just need to skip using UserDetails+UserDetailsService and use different AuthenticationManager/AuthenticationProvider implementations. Since your requirement is very exotic, you'll have to write your own AuthenticationProvider (or AuthenticationManager, but I recommend AuthenticationProvider, it will be more flexible), there won't be any built-in solution. Though you should be able to re-use built-in UsernamePasswordAuthenticationFilter for username+password since user will pass only one password in request, not both. So this should be re-usable.

nobi-Suke Автор вопроса
Dmytro Buryak
Long story short, you can't do that with UserDetai...

Thank you I created my own AuthProvider and it solve the problem.

Похожие вопросы

Обсуждают сегодня

Господа, а что сейчас вообще с рынком труда на делфи происходит? Какова ситуация?
Rꙮman Yankꙮvsky
29
А вообще, что может смущать в самой Julia - бы сказал, что нет единого стандартного подхода по многим моментам, поэтому многое выглядит как "хаки" и произвол. Короче говоря, с...
Viktor G.
2
@Benzenoid can you tell me the easiest, and safest way to bu.y HEX now?
Živa Žena
20
This is a question from my wife who make a fortune with memes 😂😂 About the Migration and Tokens: 1. How will the old tokens be migrated to the new $LGCYX network? What is th...
🍿 °anton°
2
30500 за редактор? )
Владимир
47
а через ESC-код ?
Alexey Kulakov
29
What is the Dex situation? Agora team started with the Pnetwork for their dex which helped them both with integration. It’s completed but as you can see from the Pnetwork ann...
Ben
1
Гайс, вопрос для разносторонее развитых: читаю стрим с юарта, нада выделять с него фреймы с определенной структурой, если ли чо готовое, или долбаться с ринг буффером? нада у...
Vitaly
9
Anyone knows where there are some instructions or discort about failed bridge transactions ?
Jochem
21
@lozuk how do I get my phex copies of my ehex from a atomic wallet, to move to my rabby?
Justfrontin 👀
11
Карта сайта