30 Haziran 2022 Perşembe

Jakarta EE @OpenIdAuthenticationDefinition Anotasyonu

Giriş
Açıklaması şöyle
Well, for many years, we have been using usernames and passwords for authenticating users in a web application. However, in modern applications, it has become widespread to log in using other services, e.g. Facebook, Google, Twitter, etc. The OpenID Connect protocol powers this kind of authentication. With the Jakarta Security 3.0, we now have a standard way to adhere to OpenID Connect by using just an annotation, which is @ OpenIdAuthenticationDefinition. Life is much simpler now; specify the required properties, such as Provider URI, clientId, clientSecret, redirect URI, etc.
Örnek
Şöyle yaparız
@OpenIdAuthenticationDefinition(
       providerURI = "https://sample-openid-server.com",
       clientId = "87068hgfg5675htfv6mrucov57bknst.apps.sample.com",
       clientSecret = "{my-secret}",
       redirectURI = "${baseURL}/callback",
       extraParameters = {
            "testKey=testValue", 
            "testKey2=testValue2"
       }
)

public class SecurityConfig {
}

Hiç yorum yok:

Yorum Gönder

Bean Validation @GroupSequence Anotasyonu

Örnek Elimizde şöyle bir kod olsun public class SampleRequest {   @NotNull   LocalDate startDate;   @NotNull   LocalDate endDate;   @AssertT...