idek man
Some checks failed
Some checks failed
This commit is contained in:
parent
e848b548b5
commit
242b72ca45
7 changed files with 55 additions and 26 deletions
|
@ -11,9 +11,6 @@ public class CustomJwtAuthenticationConverter implements Converter<Jwt, Abstract
|
|||
@Override
|
||||
public AbstractAuthenticationToken convert(Jwt source) {
|
||||
JwtGrantedAuthoritiesConverter authoritiesConverter = new JwtGrantedAuthoritiesConverter();
|
||||
authoritiesConverter.setAuthorityPrefix("ROLE_"); // Ensure roles have the prefix
|
||||
authoritiesConverter.setAuthoritiesClaimName("roles"); // Use Authentik's claim for roles
|
||||
|
||||
JwtAuthenticationConverter converter = new JwtAuthenticationConverter();
|
||||
converter.setJwtGrantedAuthoritiesConverter(authoritiesConverter);
|
||||
|
||||
|
|
|
@ -4,7 +4,6 @@ import org.springframework.context.annotation.Bean;
|
|||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
|
||||
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
|
||||
import org.springframework.security.config.annotation.web.configurers.oauth2.server.resource.OAuth2ResourceServerConfigurer;
|
||||
import org.springframework.security.web.SecurityFilterChain;
|
||||
|
||||
@Configuration
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue