Skip to content

Commit

Permalink
improve spring-xsuaa to spring-security migration guide #1269
Browse files Browse the repository at this point in the history
  • Loading branch information
liga-oz committed Aug 25, 2023
1 parent b293a07 commit 591cb3e
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions spring-security/Migration_SpringXsuaaProjects.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,31 @@ In case you have configured your `TokenAuthenticationConverter` with `setLocalSc

**Before**
```java
Converter<Jwt, AbstractAuthenticationToken> customJwtAuthenticationConverter() {
@Configuration
@EnableWebSecurity
public class SecurityConfiguration {

Converter<Jwt, AbstractAuthenticationToken> customJwtAuthenticationConverter() {
TokenAuthenticationConverter converter = new TokenAuthenticationConverter(xsuaaServiceConfiguration);
converter.setLocalScopeAsAuthorities(true);
return converter;
}
...
}
```

**After**
```java
@Autowired
Converter<Jwt, AbstractAuthenticationToken> authConverter;
@Configuration
@EnableWebSecurity
@PropertySource(factory = IdentityServicesPropertySourceFactory.class, ignoreResourceNotFound = true, value = { "" }) // might be auto-configured in a future release
public class SecurityConfiguration {

@Autowired
Converter<Jwt, AbstractAuthenticationToken> authConverter;

...
}
```

## Access VCAP_SERVICES values
Expand Down

0 comments on commit 591cb3e

Please sign in to comment.