G
G
grv12018-05-10 18:19:09
Java
grv1, 2018-05-10 18:19:09

How to correctly bind an entity to a user who logged in via oauth?

Tell me, how in spring to organize work with entities that are tied to an authorized user via auth?
The problem is that when a user logged in via oauth and we only know his nickname, it’s not very good to tie up saving the entity in the application through the nickname.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
piatachki, 2018-05-14
@piatachki

UserDetailsService implements the findUserByUsername (emnip) method - it returns UserDetails, and there the User entity can be obtained. Or Autentification from SecurityContext with getPrincipal. Or I misunderstood the question.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question