28 Haziran 2018 Perşembe

JAAS LoginContext Sınıfı

Giriş
Şu satırı dahil ederiz.
import javax.security.login.LoginContext;
LoginModule arayüzlerinin çağrılmasını sağlar. Açıklaması şöyle.
In Java SE, the typical / intended usage of the SPI is via the LoginContext class, which, by default, lazily instantiates and initializes each of its configured modules once, just before delegating to their login method. Subsequently, the context retains references to the very same module instances until its disposal. Hence, the lifecycle of a module depends on the lifetime of its encapsulating context.
İyi bir örnek burada.

constructor
Örnek
Şöyle yaparızz. MyLoginJAAS.conf dosyasındaki her bir LoginModule üzerinden yürüyerek, login işlemini gerçekleştirir.
CallbackHandler handler = myView;
LoginContext context = new LoginContext("MyLogin", handler);
contex.login();

getSubject metodu
Subject nesnesi döner. Açıklaması şöyle.
JAAS also borrows ideas from other established security frameworks, such as X.509 certificates, from which the name Subject is derived....
Örnek ver

login metodu
JAAS.conf dosyasındaki her bir LoginModule üzerinden yürüyerek, login işlemini gerçekleştirir.




Hiç yorum yok:

Yorum Gönder