25 Ağustos 2021 Çarşamba

SpringSecurity AbstractAuthenticationToken Sınıfı

Giriş
Şu satırı dahil ederiz
import org.springframework.security.authentication.AbstractAuthencticationToken;
Tüm AuthenticationToken sınıflarının atasıdır. Authentication arayüzünden kalıtır. Açıklaması şöyle
It is a base class for Authentication objects and creates a token with the supplied array of authorities (GrantedAuthority).

It implements Authentication interface and it has a collection of “authorities” you can set for your authenticated account and a “details” object where you can set other info you may use later (like an auth token to set to response header or save in a cache (Redis, etc.) in your custom success handler class).
gibi sınıflara bakılabilir

getCredential metodu
Bir örnek burada

getPrincipal metodu
Bir örnek burada

Hiç yorum yok:

Yorum Gönder