Created
March 19, 2024 05:05
-
-
Save alexjosesilva/b53d2322c2dc91bd5c89477d9b20d77b to your computer and use it in GitHub Desktop.
Authentication and Authorization: O cliente envia uma solicitação ao servidor com suas credenciais. O servidor autentica o cliente, verificando as credenciais
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Configuration | |
@EnableWebSecurity | |
public class SecurityConfig extends WebSecurityConfigurerAdapter { | |
@Override | |
protected void configure(HttpSecurity http) throws Exception { | |
http | |
.authorizeRequests() | |
.antMatchers("/api/**").authenticated() | |
.and() | |
.oauth2Login(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment