Skip to content

Instantly share code, notes, and snippets.

@alexjosesilva
Created March 19, 2024 05:05
Show Gist options
  • Save alexjosesilva/b53d2322c2dc91bd5c89477d9b20d77b to your computer and use it in GitHub Desktop.
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
@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