Skip to content

Commit 3a651bb

Browse files
committed
improve spring-xsuaa to spring-security migration guide #1269
1 parent c8f5104 commit 3a651bb

File tree

1 file changed

+17
-3
lines changed

1 file changed

+17
-3
lines changed

spring-security/Migration_SpringXsuaaProjects.md

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,31 @@ In case you have configured your `TokenAuthenticationConverter` with `setLocalSc
2222

2323
**Before**
2424
```java
25-
Converter<Jwt, AbstractAuthenticationToken> customJwtAuthenticationConverter() {
25+
@Configuration
26+
@EnableWebSecurity
27+
public class SecurityConfiguration {
28+
29+
Converter<Jwt, AbstractAuthenticationToken> customJwtAuthenticationConverter() {
2630
TokenAuthenticationConverter converter = new TokenAuthenticationConverter(xsuaaServiceConfiguration);
2731
converter.setLocalScopeAsAuthorities(true);
2832
return converter;
33+
}
34+
...
2935
}
3036
```
3137

3238
**After**
3339
```java
34-
@Autowired
35-
Converter<Jwt, AbstractAuthenticationToken> authConverter;
40+
@Configuration
41+
@EnableWebSecurity
42+
@PropertySource(factory = IdentityServicesPropertySourceFactory.class, ignoreResourceNotFound = true, value = { "" }) // might be auto-configured in a future release
43+
public class SecurityConfiguration {
44+
45+
@Autowired
46+
Converter<Jwt, AbstractAuthenticationToken> authConverter;
47+
48+
...
49+
}
3650
```
3751

3852
## Access VCAP_SERVICES values

0 commit comments

Comments
 (0)