All notable changes to this project will be documented in this file.
- [java-api]
SecurityContexthas been extended with a thread local storage for Service Plans.setServicePlans(),getServicePlans(),clearServicePlans()methods have been added. - [java-security]
- added support for Identity Service Proof Token validation. Proof Token validation can be enabled by
calling
JwtValidatorBuilder.enableProofTokenCheck(). Once enabled, it will forward the X509 client certificate from the request headerx-fowarded-client-certasx-client_certheader to the/oauth2/token_keysendpoint. DefaultOAuth2TokenKeyServicesaves the service plans from response headerx-osb_plan(identity broker service plan) in the newSecurityContextthread local storage for Service Plans. The header should be available when proof token validation is enabled. In this case, ax-client_certis sent in the request to/oauth2/token_keyswhich should trigger thex-osb_planresponse header.
- added support for Identity Service Proof Token validation. Proof Token validation can be enabled by
calling
- [spring-security] fixes a bug in
ReactiveHybridJwtDecoderwhen parsingiatclaim #1490
- Bump commons-io:commons-io from 2.15.1 to 2.16.1
- Bump spring.boot.version from 3.2.2 to 3.2.4
- Bump spring.core.version from 6.1.5 to 6.1.6
- Bump io.projectreactor:reactor-core from 3.6.2 to 3.6.5
- Bump com.sap.cloud.environment.servicebinding:java-bom from 0.10.3 to 0.10.4
- Bump spring.security.version from 6.2.1 to 6.2.3
- Bump org.springframework:spring-web from 6.1.4 to 6.1.5
- Bump org.json:json from 20240205 to 20240303
- [spring-xsuaa] fixes a NPE bug in
XsuaaJwtDecoderwhen uaadomain value is null - [spring-security] reactive token validation supported with a help of
ReactiveSecurityContextandReactiveHybridJwtDecoderto allow more versatile use of spring-security library, also see spring-security ReadMe.md - [samples]
- spring-security-hybrid-usage demonstrates how to use multiple Xsuaa bindings
- new sample spring-weblux-security-hybrid-usage that showcases usage of Reactive Token validation
- Bump com.sap.cloud.environment.servicebinding from 0.10.2 to 0.10.3
- Bump slf4j.api.version from 2.0.11 to 2.0.12
- Bump org.json:json from 20231013 to 20240205
- Bump org.apache.httpcomponents.client5:httpclient5 from 5.3 to 5.3.1
- Bump spring.boot.version from 3.2.1 to 3.2.2
- Bump spring.core.version from 6.1.3 to 6.1.4
- [env] service plan property is no longer uppercased when building
OAuth2ServiceConfigurationfrom service bindings of the environment - [spring-security] fixes a bug in which a second XSUAA configuration of plan "broker" was ignored in spring-security auto-configuration for versions 3.3.2 and 3.3.3
- Bump io.projectreactor:reactor-core from 3.6.1 to 3.6.2
- Bump spring.core.version from 6.1.2 to 6.1.3
- Bump slf4j.api.version from 2.0.10 to 2.0.11
- [java-security]
- reduce
HybridTokenFactorylogging noise - in case of missing service configuration warn message will be logged just once - upgrade jetty ee9 to jetty ee10
- reduce
- [java-security-test]
- fixes version mismatch issue when jetty BoM is used
JwtGeneratorensures that claims are always in the same order
- [token-client]
- remove httpclient caching from DefaultHttpClientFactory (#1416)
- Bump spring.boot.version from 3.2.0 to 3.2.1
- Bump spring.core.version from 6.0.14 to 6.1.2
- Bump log4j2.version from 2.22.0 to 2.22.1
- Bump slf4j.api.version from 2.0.9 to 2.0.10
- [java-security]
- add
nameproperty of service binding as property to OAuth2ServiceConfiguration
- add
- [java-api]
- add ServiceConstant#NAME which can be used to access that property
- [spring-security]
IdentityServicesPropertySourceFactorynow populates Spring properties with ALL Xsuaa configurations found in the environment instead of only one (arbitrary) configuration of service plan 'application' and one (optional, arbitrary) additional one of service plan 'broker'.XsuaaServiceConfigurations#getConfigurationsnow contains ALL Xsuaa configurations found as a result of the previous changeHybridIdentityServicesAutoConfigurationwas adjusted for backward compatibility to still create a JwtDecoder that uses the same XSUAA configurations as before for token validation (one of plan 'application' and an optional one of plan 'broker')- add
setNamegetName,setPlan,getPlantoOAuth2ServiceConfigurationProperties, which means, the list ofXsuaaServiceConfigurationscan now be filtered based on these properties.
- [java-security-test]
- upgrade the Jetty servlet to jetty-ee9-servlet (fixes issues with the Spring Boot 3.2 upgrade)
- Bump spring.boot.version from 3.1.6 to 3.2.0
- Bump spring.core.version from 6.0.14 to 6.1.2
- Bump spring.security.version from 6.2.0 to 6.2.1
- Bump commons-io:commons-io from 2.15.0 to 2.15.1
- Bump org.apache.httpcomponents.client5:httpclient5 from 5.2.3 to 5.3
- Bump log4j2.version from 2.21.1 to 2.22.0
- Bump io.projectreactor:reactor-core from 3.5.11 to 3.6.0
- Bump org.eclipse.jetty:jetty-bom from 11.0.18 to 12.0.5
✅ Resolves a Breaking Change introduced in version 3.3.0. Consumers should be able to update to 3.3.1 from a version < 3.3.0 without having to adjust test credentials used in their unit tests when using java-security-test or spring-xsuaa-mock.
In version 3.3.1, when java-security-test is loaded (which should only occur during testing), credentials with localhost as the uaadomain (XSUAA) or trusted domains (IAS) can be used to validate tokens that include a port for localhost in their jku (XSUAA) or issuer (IAS). It's important to note that token validation is less strict in this case and may accept certain edge cases of malicious tokens that would not be accepted in a production environment.
- Bump spring.boot.version from 3.1.5 to 3.1.6
- Bump spring.core.version from 6.0.13 to 6.0.14
- Bump spring.security.version from 6.1.5 to 6.2.0
- Bump apache.httpclient5.version from 5.2.1 to 5.2.3
- Bump wiremock.version from 3.0.0-beta-10 to 3.3.1 and replace org.wiremock.wiremock-standalone with com.github.tomakehurst.wiremock
- Bump logback-core, logback-classic from 1.4.6 to 1.4.14
Breaking Change
Likewise, for validating IAS tokens issued by the java-security-test module, the trusted domains array of the service configuration needs to include the Wiremock URL including the port but NOT the protocol, i.e. in the format localhost:<PORT>.
The full wiremock URL including http:// and <PORT> is available via SecurityTestContext#getWireMockServer#baseUrl.
- [java-security]
- [XSUAA/IAS] Adapt optimized server API
- [spring-xsuaa]
- Adapt optimized server API
Hot fix for the CVE-2023-5072
- Bump spring.boot.version from 3.1.4 to 3.1.5
- Bump log4j2.version from 2.20.0 to 2.21.0
- Bump spring.security.version from 6.1.4 to 6.1.5
- Bump org.json:json from 20230618 to 20231013
- [java-security]
- add x-azp header to IAS JWKS fetching and adjust JWKS cache key
OAuth2TokenKeyServiceandOAuth2TokenKeyServiceWithCache- Refactor API to use generic Map instead of explicit IAS-specific parameters
- Bump io.projectreactor:reactor-core from 3.5.9 to 3.5.11
- Bump spring.core.version from 6.0.11 to 6.0.13
- Bump spring.security.version from 6.1.3 to 6.1.4
- Bump commons-io:commons-io from 2.13.0 to 2.14.0
- Bump com.sap.cloud.environment.servicebinding from 0.9.0 to 0.10.0
- Bump spring.boot.version from 3.1.3 to 3.1.4
- Bump slf4j.api.version from 2.0.7 to 2.0.9
- [java-security]
- Fixes NPE when accessing
XsuaaToken.getPrincipal()andgrantTypeis null (#1261)
- Fixes NPE when accessing
- [token-client]
- fixes JWKs fetch from identity service issue when
app_tidis not present in the token - theX-app_tidandX-client_idheaders are only added when both values are available. DefaultOAuth2TokenService- fixes issue when in case of unsuccessful token fetch
OAuth2ServiceException.withHeaders()headers field were filled with only one entry containing all headers as a string
- fixes issue when in case of unsuccessful token fetch
DefaultOAuth2TokenKeyServiceandSpringOAuth2TokenKeyService- improved error handling
OAuth2ServiceExceptionthat's thrown status code != 200 case doesn't get swallowed- fixes
OAuth2ServiceException.withHeaders()semantically incorrect behavior when headers were filled with request headers instead of response headers OAuth2ServiceExceptiongenerated by unsuccessful JWKs fetch contains request headers as well
- improved error handling
OAuth2ServiceExceptionupdated header message - contains nowResponse Headersinstead ofHeaders
- fixes JWKs fetch from identity service issue when
- Bump spring.security.version from 6.1.2 to 6.1.3
- Bump spring.boot.version from 3.1.2 to 3.1.3
- [token-client]
OAuth2ServiceExceptionhas been extended with getter methodgetHeaders()that gives the access to failed request's response headersXsuaaOAuth2TokenServiceandDefaultOAuth2TokenServiceadd the response headers and status code to the thrownOAuth2ServiceException
- [env]
ServiceBindingEnvironmenthas been extended with a methodgetServiceConfigurationsAsList()that returns a list of all available service configurations parsed from environment- in case of multiple service configurations of the same service plans
ServiceBindingEnvironment.getXsuaaConfiguration()andServiceBindingEnvironment.getServiceConfigurations()will return the first one from the list. This adjustment ensures that the logic is in line with the 2.x major version.
- [token-client] reverted removal of
OAuth2ServiceException.getHttpStatusCode()
- Bump com.sap.cloud.environment.servicebinding:java-bom from 0.8.0 to 0.9.0
The zone_uuid claim in Identity service tokens has been deprecated and is now replaced by the app_tid claim. You should use the app_tid claim to identify the unique tenant id, which was previously referred to as the zone.
- [java-api]
Tokeninterface is extended with default methodgetAppTid()andgetZoneId()method has been deprecated, usegetAppTid()method insteadTokenClaimsis extended with theSAP_GLOBAL_APP_TIDandSAP_GLOBAL_ZONE_IDis deprecated
- [token-client]
OAuth2TokenKeyServiceinterface has been extended withretrieveTokenKeys(@Nonnull URI tokenKeysEndpointUri, @Nullable String tenantId, @Nullable String clientId)methodHttpHeadersconstants are extended withX-app_tidabdX-client_idheaders- JWKs fetch from identity service going forward requires mandatory headers:
X-app_tidabdX-client_idthis has been updated in the default implementations of theOAuth2TokenKeyService:DefaultOAuth2TokenKeyServiceOAuth2TokenKeyServiceWithCache(java-security module)SpringOAuth2TokenKeyService
- [java-security]
AbstractTokenis serializable fixes #1209
- Bump spring.core.version from 6.0.9 to 6.0.11
- Bump spring.boot.version from 3.0.6 to 3.1.2
- Bump spring.security.version from 6.0.3 to 6.1.2
- Bump reactor-core from 3.5.6 to 3.5.8
- Bump btp-environment-variable-access from 0.6.0 to 0.8.0
- Bump json from 20230227 to 20230618
- Bump commons-io from 2.11.0 to 2.13.0
- [spring-xsuaa] fixes incompatible TLS version for
DefaultSpringHttpClientFactory
- Bump spring.core.version from 6.0.8 to 6.0.9
- Bump reactor-core from 3.5.5 to 3.5.6
- Bump btp-environment-variable-access from 0.5.2 to 0.6.0
cloud-security-services-integration-library requires
- Java 17
- Spring Boot 3.0.x
- Spring security 6.0.x
- Identity service configurations need to provide domains via String array in JSON key 'identity.credentials.domains'. Providing String values under key 'identity.credentials.domain' is not supported anymore. IAS configurations from service bindings have been generated like this for a long time already. This should only affect old configuration files manually written for testing.
spring-xsuaa-mock→ use java-security-test instead
- [api]
XSPrincipal,XSUserInfoException→ not needed anymore with new Token interface
- [env]
CFEnvironment,K8sEnvironment→ use insteadServiceBindingEnvironmentCFConstants,K8sConstants→ use insteadServiceConstants
- [java-security]
XSUserInfo,XSUserInfoAdapter→ use instead Token interface andToken#getClaimAsStringwith TokenClaims.XSUAA constants to access XSUAA-specific claims.SAPOfflineTokenServicesCloud→ use instead [spring-security] module
- [spring-xsuaa]
XSTokenRequest,TokenBroker,UaaTokenBroker→ use instead token-client module to fetch XSUAA tokens via XsuaaTokenFlowsTokenBrokerResolver,AuthenticaionMethod→ No longer provided. Seespring-security-basic-authsample how to write your own implementation.IasXsuaaExchangeBroker→ Exchange is not supported by XSUAA service anymore.TokenUrlUtils→ use insteadOAuth2ServiceEndpointsProviderXsuaaServicesParser→ use insteadEnvironments#getCurrentornew ServiceBindingEnvironment(new SapVcapServicesServiceBindingAccessor(any -> xsuaaConfigJson))OAuth2AuthenticationConverter→ Not supported anymore because deprecated by Spring Security: https://github.com/spring-projects/spring-security/wiki/OAuth-2.0-Migration-Guide
- [token-client]
UserTokenFlow→ use insteadJwtBearerTokenFlow
- [java-security]
OAuth2TokenKeyServiceWithCache#withCacheTime,OAuth2TokenKeyServiceWithCache#withCacheSize→ use insteadOAuth2TokenKeyServiceWithCache#withCacheConfigurationSAPOfflineTokenServicesCloud#SAPOfflineTokenServicesCloud(OAuth2ServiceConfiguration)→
- [java-security-test]
SecurityTestRule#getConfigurationBuilderFromFile→ use insteadSecurityTestRule#getOAuth2ServiceConfigurationBuilderFromFileSecurityTestRule#getWireMockRule→ use insteadSecurityTestRule#getWireMockServer
- [spring-xsuaa]
Token#getExpirationDate→ use insteadToken#getExpiration
- [spring-xsuaa-test]
Base64JwtDecoder#Base64JwtDecoder→ use insteadBase64JwtDecoder#getInstance
- [token-client]
XsuaaTokenFlows#userTokenFlow→ use insteadXsuaaTokenFlows#jwtBearerTokenFlowOAuth2TokenService#retrieveAccessTokenViaUserTokenGrant→ use insteadOAuth2TokenService#retrieveAccessTokenViaJwtBearerTokenGrantOAuth2TokenService#retrieveAccessTokenViaClientCredentialsGrant(URI, ClientIdentity, String, Map, boolean)→ use instead OAuth2TokenService#retrieveAccessTokenViaClientCredentialsGrant with null for argumentsubdomainDefaultOAuth2TokenService#DefaultOAuth2TokenService→ use insteadDefaultOAuth2TokenService#DefaultOAuth2TokenService(CloseableHttpClient)XsuaaOAuth2TokenService#XsuaaOAuth2TokenService→ use insteadXsuaaOAuth2TokenService#XsuaaOAuth2TokenService(CloseableHttpClient)DefaultOAuth2TokenService#DefaultOAuth2TokenService(TokenCacheConfiguration)→ use insteadDefaultOAuth2TokenService#DefaultOAuth2TokenService(CloseableHttpClient, TokenCacheConfiguration)XsuaaOAuth2TokenService#XsuaaOAuth2TokenService(TokenCacheConfiguration)→ use insteadXsuaaOAuth2TokenService#XsuaaOAuth2TokenService(CloseableHttpClient, TokenCacheConfiguration)XsuaaDefaultEndpoints#XsuaaDefaultEndpoints(URI),XsuaaDefaultEndpoints#XsuaaDefaultEndpoints(String)→ use insteadXsuaaDefaultEndpoints#XsuaaDefaultEndpoints(String, String)OAuth2TokenResponse#getExpiredAtDate→ use insteadOAuth2TokenResponse#getExpiredAtBase64JwtDecoder#Base64JwtDecoder→ use insteadBase64JwtDecoder#getInstance
- [java-api]
GrantType#USER_TOKEN→ use insteadGrantType#JWT_BEARER
- [token-client]
OAuth2TokenServiceConstants#GRANT_TYPE_USER_TOKEN→ use insteadGrantType#JWT_BEARER
- [spring-xsuaa]
Token#GRANTTYPE_CLIENTCREDENTIAL→ use insteadGrantType#CLIENT_CREDENTIALS
- [spring-xsuaa] improved logging for JwtAudienceValidator
- [java-security] enables token validation without zones
- Bump httpclient from 4.5.13 to 4.5.14
- Bump btp-environment-variable-access java-bom from 0.5.1 to 0.5.2
- Bump spring.boot.version from 2.7.5 to 2.7.8
- Bump spring.core.version from 5.3.23 to 5.3.25
- Bump spring.security.version from 5.7.5 to 5.8.1
- Bump slf4j.api.version from 2.0.3 to 2.0.6
- [spring-xsuaa][spring-security]
- Patches CVE-2022-31692 vulnerability in spring security dependency.
- [java-security-test]
scim_idadded as default attribute for identity token Jwt generator
- Bump spring.security.version from 5.7.3 to 5.7.5
- Bump btp-environment-variable-access java-bom from 0.4.1 to 0.5.1
- Bump spring.boot.version from 2.7.3 to 2.7.5
- Bump reactor-core from 3.4.23 to 3.4.24
- Bump slf4j.api.version from 2.0.0 to 2.0.3
- Bump spring-boot-starter-parent from 2.7.3 to 2.7.5
- [spring-xsuaa-starter]
- Patches CVE 2022-25857 vulnerability in spring boot starter transient dependency.
- Bump spring-boot-starter-parent from 2.7.1 to 2.7.3
- Bump slf4j.api.version from 1.7.36 to 2.0.0
- [java-security] Bug fix for regression in
XSUserInfoAdapter.getMultiValueAttributeFromExtObject()when error was thrown accessing xs.user.attributes with empty array value. It throws an error only in case of non existing attribute as before 2.12.3
- Bump spring.security.version from 5.7.2 to 5.7.3
- Bump java-bom(https://github.com/SAP/btp-environment-variable-access) from 0.4.0 to 0.4.1
-
[token-client]
DefaultHttpClientFactorycreatesCloseableHttpClientwith disabled redirects to avoid security vulnerabilities.
‼️ For your customCloseableHttpClientimplementation make sure to disable redirects as well.‼️ - all
TokenServicesandTokenKeyServiceshave been enhanced to add to all outgoing requests auser-agentheader that contains valuetoken-client/x.x.xwhere x.x.x is token-client version being used
-
[spring-xsuaa]
XsuaaJwtDecodercatches bases64 decoderIllegalArgumentExceptionthat can be caused by decoding malformedverificationkeyfrom xsuaa service configuration to avoid500 Internal server errorresponses
- Bump
spring.boot.versionfrom 2.7.1 to 2.7.2. - Bump https://github.com/SAP/btp-environment-variable-access from 0.3.1 to 0.4.0.
- Bump reactor-core from 3.4.21 to 3.4.22
- [env]
- uses https://github.com/SAP/btp-environment-variable-access (version 0.3.1), which supports access to service credentials in K8s/Kyma environment provisioned by SAP BTP Service Operator. Usage of service-catalog is no longer supported. With that there is no service-manager longer required to distinguish the service instance plan, when multiple xsuaa instances are bound (#855).
- [token-client]
- NPE bug fix for
UriUtil.replaceSubdomain(@Nonnull URI, @Nullable subdomain)in cases when provided URI does not contain host(no http/s schema provided) #943
- NPE bug fix for
- [samples]
java-security-usage,spring-security-basic-auth,spring-security-hybrid-usageadjusted for service-operator higher than v0.2.3 usage
- Bump log4j2.version from 2.17.2 to 2.18.0
- Bump
spring.core.versionfrom 5.3.21 to 5.3.22. - Bump reactor-core from 3.4.19 to 3.4.21.
Full Changelog: https://github.com/SAP/cloud-security-services-integration-library/compare/2.12.3...2.13.0
- [spring-xsuaa][spring-security-compatibility]
- bug fix for #910
XsuaaToken.getXSUserAttribute,XsuaaTokenComp.getXSUserAttributemethods' returnnullif claim is not present as documented in javadoc.
- bug fix for #910
- [java-api]
Token.getAttributeFromClaimAsStringListjavadoc has been fixed, this method supposed to return emptyListin case of missing attribute notnull
- Bump spring.security.version from 5.7.1 to 5.7.2
- Bump spring.boot.version from 2.7.0 to 2.7.1
- Bump spring.core.version from 5.3.20 to 5.3.21
- Bump reactor-core from 3.4.18 to 3.4.19
- Bump spring-boot-starter-parent version from 2.6.7 to 2.7.1
- [spring-xsuaa][spring-security]
- Fixes CVE-2022-22978 vulnerability in spring security version
- Bump spring.security.version from 5.6.3 to 5.7.1
- Bump spring.boot.version from 2.6.7 to 2.7.0
- [java-security]
JwtIssuerValidatorrules have been relaxed, it accepts issuers withouthttpsschema
- Bump jackson-databind from 2.13.2.2 to 2.13.3
- Bump spring.core.version from 5.3.19 to 5.3.20
- Bump reactor-core from 3.4.17 to 3.4.18
- [token-client]
- DefaultHttpClientFactory does not longer log warning messages in case of cert-based Apache Http Clients.
- Usages of HTTP Clients as part of this client library are depicted here.
- This improves the default Apache Http Client configuration, provided with
DefaultHttpClientFactory, so that warning message described here is no longer logged in case of certificate based setup, and stakeholders must not overwrite the default configuration. - In case there is no certificate given in
VCAP_SERVICESa default http client gets created (HttpClients.createDefault()) and the message is still logged with severityWARNING.
It sets
- connect timeout = 5 sec
- connection request timeout = 5 sec
- socket timeout = 5 sec
Furthermore, it makes sure that per client id SSLContext, SSLConnectionSocketFactory and PoolingHttpClientConnectionManager are created only once per instance.
It introduces a PoolingHttpClientConnectionManager and limits
- maximum connections per route to 4 (default is 2)
- and the maximum connections to 20
- Bump spring-security-oauth2 from 2.5.1.RELEASE to 2.5.2.RELEASE
- Bump spring-boot-starter version from 2.6.6 to 2.6.7
- [java-security] [spring-security] JwtSignatureValidator improvements:
- Only identity service requires
x-zone_uuidheader for token keys retrieval - in case of signature mismatch the result should expose the signature of the encoded JWT token
- Only identity service requires
- [spring-security]
Introduces with
spring-security-compatibilitya compatibility module that provides withXsuaaTokenCompclass an option to decorate a token issued by xsuaa tocom.sap.cloud.security.xsuaa.token.Tokenapi, which was used inspring-xsuaa.- See also Migration Guide and PR #847
- Bump spring-boot-starter-parent version from 2.5.2 to 2.6.6 (only in samples)
- Bump reactor-core from 3.4.16 to 3.4.17
- Bump spring.security.version from 5.6.2 to 5.6.3
[spring-xsuaa][spring-security]
- Fixes CVE-2022-22965 vulnerability in spring version
- Bump spring.core.version from 5.3.17 to 5.3.18
- Bump spring.boot.version from 2.6.5 to 2.6.6
- [java-security] [spring-security]
- Never log certificates
- Improves JWKS cache handling for OIDC token validation. This is especially relevant when using a shared IAS tenant.
- Adds further logs in respect to key mismatches.
- [spring-xsuaa]
- XsuaaJwtDecoder must ignore line breaks in verificationkey
- [java-security-test]
- Bump jackson-databind.version from 2.12.1 to 2.13.2.2 (solves security vulnerability)
- Bump slf4j.api.version from 1.7.35 to 1.7.36
- Bump spring.security.version from 5.6.1 to 5.6.2
- Bump log4j2.version from 2.17.1 to 2.17.2
- Bump spring.boot.version from 2.6.3 to 2.6.4
- Bump reactor-core from 3.4.15 to 3.4.16
- Bump json from 20211205 to 20220320
- Bump spring.core.version from 5.3.15 to 5.3.17
- [java-security]
- removes audience check as part of
JwtX5tValidator
- removes audience check as part of
- [spring-xsuaa]
- XsuaaServiceConfigurationDefault supports access to other credentials (fix #802)
- XsuaaServiceConfigurationDefault supports non relaxed-binding rules for non spring framework cases
- auto-configures mtls-based rest operations w/o credential-type=x509 property
- [spring-security]
- HybridJwtDecoder should support xsuaa only (see #790)
- auto-configures mtls-based rest operations w/o credential-type=x509 property
- [java-security]
XsuaaTokenAuthenticatorshould support validation of tokens issued by Cloud Foundry UAA (NGPBUG-175120)
- Bump reactor-core from 3.4.13 to 3.4.14
- Bump spring.core.version from 5.3.14 to 5.3.15
- Bump slf4j.api.version from 1.7.32 to 1.7.35
- Bump spring.boot.version from 2.6.2 to 2.6.3
- Ensure compatibility with Java 11 (see PR #775)
- [spring-xsuaa-starter]
xsuaaMtlsRestOperationsandxsuaaRestOperationsare only auto-configured ifXsuaaServiceConfigurationbean is given - [java-security] Support oidc tokens from single tenant apps w/o zone_uuid claim (NGPBUG-170120)
- remove net.minidev:json-smart
- Bump log4j2.version from 2.17.0 to 2.17.1
[spring-xsuaa-starter] Patches CVE-2021-42550
- Bump spring.boot.version from 2.6.1 to 2.6.2 contains logback 1.2.9 (CVE-2021-42550)
- Bump dependency-check-maven from 6.5.0 to 6.5.1
- Bump logcaptor from 2.7.4 to 2.7.7
- provides Bill of Material that helps you to keep all of your SAP security related dependencies on sync:
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.sap.cloud.security</groupId>
<artifactId>java-bom</artifactId>
<version>...</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>See sample.
- Bump spring.security.version from 5.6.0 to 5.6.1
- Bump spring.core.version from 5.3.13 to 5.3.14
- Bump log4j-api to 2.17.0 (CVE-2021-45105)
- Sets Spring property
log4j2.versionto2.17.0and overwritesorg.apache.logging.log4j:log4j-to-slf4jandorg.apache.logging.log4j:log4j-apiversion used in the Spring projects. This patch is not urgent, see also Blog: Log4J2 Vulnerability and Spring Boot. - Bump reactor-core from 3.4.12 to 3.4.13
- Bump log4j-to-slf4j from 2.14.1 to 2.17.0
- [token-client] hotfix for token cache miss issue
- org.json.version 20210307 --> 20211205
- spring.boot.version 2.6.0 --> 2.6.1
- caffeine 2.9.2 --> 2.9.3
- com.github.tomakehurst:wiremock-jre8-standalone 2.31.0 --> 2.32.0
- [java-api]
SecurityContexthas been extended to provide thread-wide X.509 certificate storage
- [java-security]
- Introduces X.509 certificate thumbprint validator
JwtX5tValidatoras described here IasTokenAuthenticatorandXsuaaTokenAuthenticatorstore the forwarded X.509 certificate for incoming requests inSecurityContextXsuaaDefaultEndpointsprovides a new constructor(url, certUrl) (issue 707)
- Introduces X.509 certificate thumbprint validator
- [spring-xsuaa]
XsuaaServiceConfigurationinterface default methodgetClientIdentity()needs to be overridden to be used- ❗ Incompatible change
XsuaaCredentialsgetPrivateKey()setPrivateKey()has changed togetKey()setKey()to reflect the attribute name from configuration
- [token-client] Adds
X-CorrelationIDheader to outgoing requests. In case MDC provides "correlation_id" this one is taken (issue 691)
- io.projectreactor:reactor-test 3.4.11 --> 3.4.12
- io.projectreactor:reactor-core 3.4.11 --> 3.4.12
- dependency-check-maven-plugin 6.4.1 --> 6.5.0
- org.springframework:spring.core.version 5.3.12 --> 5.3.13
- org.springframework:spring.security.version 5.5.3 --> 5.6.0
- org.springframework.boot:spring-boot 2.5.6 to 2.6.0
- logcaptor 2.7.0 --> 2.7.2
- [spring-xsuaa] fixes issue in
TokenBrokerResolverforCLIENT_CREDENTIALSmethod (issue 705)
- [java-security][spring-security] supports custom domains of identity service. If
ias_issis given and not empty,JwtIssuerValidator.javachecks whether its a valid url and checks whether this matches one of the valid domains of the identity service. The check whetherissmatches to any given domains is skipped in that case. - Resolves regression in
XsuaaServiceConfigurationDefault(fixes #695)
- io.projectreactor:reactor-test 3.4.10 --> 3.4.11
- io.projectreactor:reactor-core 3.4.10 --> 3.4.11
- org.springframework:spring.core.version 5.3.10 --> 5.3.12
- org.springframework.boot:spring-boot 2.5.4 to 2.5.6
📣 Client Libraries support Kubernetes/Kyma environment
- [env]
- The extraction of
OAuth2ServiceConfigurationfor xsuaa oder ias identity provider is moved intocom.sap.cloud.security:envclient library. - Extended with Kubernetes/Kyma environment support
- The extraction of
- [samples/java-security-usage] enabled for Kyma/Kubernetes environment
- [samples/spring-security-basic-auth] enabled for Kyma/Kubernetes environment
- [samples/spring-security-hybrid-usage] enabled for Kyma/Kubernetes environment
- [spring-xsuaa]
LocalAuthoritiesExtractorsupports alsoappIds that contains pipe (|) characters #640. - [spring-security]
XsuaaTokenAuthorizationConvertersupports alsoappIds that contains pipe (|) characters #640.
- maven-javadoc-plugin 3.3.0 --> 3.3.1
- maven-pmd-plugin 3.14.0 --> 3.15.0
- dependency-check-maven 6.2.2 --> 6.3.1
- com.github.tomakehurst:wiremock-jre8-standalone 2.30.1 --> 2.31.0
- io.projectreactor:reactor-test 3.4.9 --> 3.4.10
- io.projectreactor:reactor-core 3.4.9 --> 3.4.10
- org.springframework:spring.core.version 5.3.9 --> 5.3.10
- org.springframework.boot:spring-boot 2.5.3 to 2.5.4
- org.mockito:mockito-core 3.11.2 --> 3.12.4
- [token-client]
- new method
SSLContextFactory.createKeyStore(ClientIdentity) XsuaaTokenFlowsconstructor acceptscom.sap.cloud.security.xsuaa.client.ClientCredentialsas argument.
- new method
- org.springframework.security:spring-security-oauth2-jose 5.5.1 --> 5.5.2
- org.springframework.security:spring-security-oauth2-resource-server 5.5.1 --> 5.5.2
- org.springframework.security:spring-security-oauth2-jose 5.5.1 --> 5.5.2
- org.springframework.security:spring-boot-starter-test 5.5.1 --> 5.5.2
- [java-security] Enrich
JsonParsingExceptionto detect wrong authorization headers earlier - [token-client]
ClientCredentials: solves incompatible change between 2.9.0 and 2.10.0OAuth2TokenResponse.getTokenType()exposes token type as provided by token request
- [spring-xsuaa]
XsuaaServiceConfigurationDefault.hasProperty("apiurl")returns true if VCAP_SERVICES-xsuaa-credentials contains attribute "apiurl" -XsuaaServiceConfigurationDefault.getProperty("apiurl")returns value from VCAP_SERVICES-xsuaa-credentials-apiurl or null, if attribute does not exist.
- [spring-security]
HybridJwtDecoderraisesBadJwtExceptionin case the token is invalid and can not be decoded properly.
- wiremock 2.29.1 --> 2.30.1
- io.projectreactor:reactor-core 3.4.8 --> 3.4.9
- io.projectreactor:reactor-test 3.4.8 --> 3.4.9
- org.springframework.boot:spring-boot 2.5.0 --> 2.5.2
- slf4j-api 1.7.30 --> 1.7.32
- caffeine 2.8.8 --> 2.9.2
- mockito 3.10.0 --> 3.11.2
- assertj 3.19.0 --> 3.20.2
- commons-io:commons-io 2.9.0 --> 2.11.0
- io.projectreactor:reactor-test 3.4.5 -> 3.4.8
- io.projectreactor:reactor-core 3.4.6 --> 3.4.8
- com.github.tomakehurst:wiremock-jre8-standalone 2.27.2 --> 2.29.1
- removes mockwebserver from parent
- [spring-security] and starter are released with project version:
2.10.2. - [spring-xsuaa]
TokenBrokerResolversupports X.509 authentication method. - [samples/spring-security-basic-auth] deprecates the xsuaa security descriptor with a client secret authentication, default now is X.509 based authentication.
- [java-security-test] requires
javax.servlet:javax.servlet-apidependency to be provided.
- org.springframework.boot:spring-boot 2.5.0 --> 2.5.2
- org.springframework:spring-core 5.3.7 --> 5.3.8
- org.springframework.security:spring-security-oauth2-jose 5.5.0 --> 5.5.1
- org.springframework.security:spring-security-oauth2-resource-server 5.5.0 --> 5.5.1
- org.springframework.security:spring-security-oauth2-jose 5.5.0 --> 5.5.1
- org.springframework.security:spring-boot-starter-test 5.5.0 --> 5.5.1
- org.springframework.security.oauth:spring-security-oauth2 2.5.0.RELEASE --> 2.5.1.RELEASE
- [samples] Upgraded approuter version to "^10.4.3"
- [java-api] provides
ClientIdentitywith 2 implementations:ClientCredentialsandClientCertificate - [token-client]
XsuaaTokenFlowssupports X.509 authentication method. In order to enable X.509 you probably need to provideorg.apache.httpcomponents:httpclientas dependency and need to configureXsuaaTokenFlowsdifferently:XsuaaDefaultEndpoints(url)must be replaced withXsuaaDefaultEndpoints(<OAuth2ServiceConfiguration>).DefaultOAuth2TokenServiceconstructors that are not parameterized withCloseableHttpClientare deprecated, as they do not support X.509.XsuaaOAuth2TokenServiceconstructors that are not parameterized withRestOperationsare deprecated, as they do not support X.509.- Find more detailed information here.
SSLContextFactoryclass, which was marked as deprecated, is moved tocom.sap.cloud.security.mtlspackage.- logs 'WARN' message, in case application has not overwritten the default http client. Find further information about that here.
- [java-security]
IasXsuaaExchangeBrokersupports X.509 based token exchange. In case the token exchange is done viaXsuaaTokenAuthenticatoryou need to provide a http client that is prepared with ssl context.JwtIssuerValidator.javasupports custom domains of identity service. Ifias_issis given and not empty,JwtIssuerValidator.javachecks whether its a valid url and checks whether this matches one of the valid domains of the identity service. The check whetheriasmatches to any given domains is skipped in that case.- The token keys cache does not accept cache time longer than 15 minutes.
- [spring-xsuaa] and starter
- As of Spring Security version 5.5.0 only
BadJwtExceptionresults inInvalidBearerTokenException, which are handled and mapped to401status code. Consequently,XsuaaJwtDecoderraisesBadJwtExceptions instead ofJwtExceptions. XsuaaTokenFlowAutoconfigurationsupports X.509 based authentication. You need to provideorg.apache.httpcomponents:httpclientas dependency.IasXsuaaExchangeBrokercan be configured with (autoconfigured)XsuaaTokenFlowto enable X.509 based authentication.- As of version
2.10a warningIn productive environment provide a well configured client secret based RestOperations bean.is exposed to the application log in case the default implementation ofRestOperationsis used and not overwritten by an own well-defined one. See also here.
- As of Spring Security version 5.5.0 only
- [spring-security] and starter
XsuaaTokenFlowAutoconfigurationsupports X.509 based authentication. You need to provideorg.apache.httpcomponents:httpclientas dependency.HybridJwtDecoderraisesBadJwtExceptions instead ofAccessDeniedExceptions.- As of version
2.10a warningIn productive environment provide a well configured client secret based RestOperations bean.is exposed to the application log in case the default implementation ofRestOperationsis used and not overwritten by an own well-defined one.
- [samples/java-tokenclient-usage] uses X.509 based authentication for
XsuaaTokenflows - [samples/spring-security-xsuaa-usage] deprecates the xsuaa security descriptor with a client secret authentication, default now is X.509 based authentication.
- [samples/spring-security-hybrid-usage] switched now to X.509 based authentication.
- [java-security] and [spring-security] validates IAS OIDC tokens from multiple IAS tenants and zones.
Prerequisite: identity service broker needs to provide list ofdomainsviaVCAP_SERVICES-identity-credentials. - [spring-security] Resource Server raises
InvalidBearerTokenExceptionin case token couldn't be successfully validated (as documented here). Adapt your configuation locally according to this documentation.
- commons-io:commons-io 2.8.0 --> 2.9.0
- org.springframework.boot:spring-boot 2.4.5 --> 2.5.0
- org.springframework:spring-core 5.3.6 --> 5.3.7
- org.springframework.security:spring-security-oauth2-jose 5.4.6 --> 5.5.0
- org.springframework.security:spring-security-oauth2-resource-server 5.4.6 --> 5.5.0
- org.springframework.security:spring-security-oauth2-jose 5.4.6 --> 5.5.0
- org.springframework.security:spring-boot-starter-test 5.4.6 --> 5.5.0
- org.junit.jupiter 5.7.1 --> 5.7.2
- org.mockito:mockito-core 3.9.0 --> 3.10.0
- [token-client] Bug fix As of now, client-credential and jwt bearer user tokens are not cached in case tokenflow is configured with zone-id (instead of subdomain).
- [java-security] provides
SapIdToken.getCnfX509Thumbprint()method to provide thumbprint of certificate, in case token was requested via X509 based authentication. - [java-api] provides
Token.getGrantType()method, proprietaryGrantType.CLIENT_X509gets deprecated.
- [spring-security] and [spring-security-starter]
HybridIdentityServicesAutoConfigurationsupports Identity service configuration alone, by setting upIasJwtDecoder
- [token-client]
OAuth2ServiceExceptionprovidesgetHttpStatusCode(). This allows applications to retry e.g. in case of429- when the request was rate limited.
- spring.security.version 5.4.5 --> 5.4.6
- spring.core.version 5.3.5 --> 5.3.6
- spring.boot.version 2.4.4 --> 2.4.5
- org.json.version 20201115 --> 20210307
- junit.version 4.13.1 --> 4.13.2
- junit-jupiter.version 5.7.0 --> 5.7.1
- reactor.version 3.4.2 --> 3.4.5
- reactor.test.version 3.4.2 --> 3.4.5
- [spring-xsuaa] introduced spring properties for IAS -> Xsuaa token exchange activation, as described here
- [java-security-test] uses jetty BoM to fix CVE-2021-28164 and CVE-2021-28165.
- jetty 9.4.38.v20210224 --> 9.4.39.v20210325
- [java-security-test] and java samples to fix CVE-2021-28164 and CVE-2021-28165.
- jetty 9.4.38.v20210224 --> 9.4.39.v20210325
- [spring-xsuaa]
- exclude transient dependency to net.minidev:json-smart to resolve CVE-2021-27568
- [xsuaa-spring-boot-starter] [resourceserver-security-spring-boot-starter]
- spring-boot-starter 2.4.3 --> 2.4.4
- spring-boot-starter-security 2.4.3 --> 2.4.4
- net.minidev:json-smart 2.3 --> 2.4.2 to resolve CVE-2021-27568
- [java-security-test] and java samples
- jetty 9.4.36.v20210114 --> 9.4.38.v20210224 (seems to be incompatible with javax.servlet-api 3.1.0)
- javax.servlet:javax.servlet-api 3.1.0 --> 4.0.1 (recommended version)
- [java-security] supports with
SpringSecurityContexta way to read tokens from Spring'sSecurityContextHolder, in case a token was set by the application using one of these client-libraries:org.springframework.security.oauth:spring-security-oauth2com.sap.cloud.security.xsuaa:spring-xsuaacom.sap.cloud.security:spring-security
- [xsuaa-spring-boot-starter] and [resourceserver-security-spring-boot-starter (BETA)]
- spring.core.version 5.3.3 --> 5.3.4
- spring.boot.version 2.4.2 --> 2.4.3
- spring.security.version 5.4.2 --> 5.4.5
- use
spring-boot-starter-parentversion 2.4.3 in spring samples.
- [token-client] Next to subdomain
XsuaaTokenFlows.clientCredentialsTokenFlow()supports Zone id.
- [spring-security] new spring boot security client library that supports Token validation from XSUAA and IAS identity provider in parallel as described here. An initial migration guide on how to migrate from
spring-xsuaais available here.
- [java-security] load environment from
VCAP_SERVICESformatted json file (#471) - [java-security] performance: make sure ServiceLoader loads services only once (#467)
- [java-api] move
getAttributeFromClaimAsStringandgetAttributeFromClaimAsStringListmethods fromAccessTokento itsTokenparent interface.
- [java-security] Make HybridTokenFactory more failure tolerant
- [spring-xsuaa-test] Prefills "ext_atr" "enhancer" with XSUAA
- [all]
- commons-io 2.6 --> 2.8.0
- org.apache.httpcomponents » httpclient 4.5.9 --> 4.5.13
- spring.core.version 5.3.2 --> 5.3.3
- spring.boot.version 2.4.1 --> 2.4.2
- [java-security-test]
- org.eclipse.jetty 9.4.35.v20201120 --> 9.4.36.v20210114
- [token-client]
- caffeine 2.8.6 --> 2.8.8
- org.json 20200518 --> 20201115
- [spring-xsuaa]
- caffeine 2.8.6 --> 2.8.8
- reactor-core 3.3.7.RELEASE --> 3.4.2
- log4j-to-slf4j 2.13.3 --> 2.14.0
- [java-api]
AccessTokenexposes thegetSubaccountId()method. Further information about the usage ofgetSubaccountId()andgetZoneId()can be read here. - [java-api] [java-security] allows hybrid token creation via
Token.create(String encodedToken). The feature is available when using token authenticator. In order to avoidServiceLoaderissues, make sure that you don't mix up different versions of these client libraries. E.g., its not possible to usecom.sap.cloud.security:java-api:2.8.3together withcom.sap.cloud.security:java-security:2.8.2. See also here. - [samples/sap-java-buildpack-api-usage] uses SAP Java Buildpack BoM (sample).
- [token-client]
UserTokenFlowenhances request withX-zidheader that corresponds to zone id.
- [java-security]
- HOTFIX for
2.8.1version. - Beta release of ias2xsuaa token exchange. Further information can be found here.
- HOTFIX for
- [spring-xsuaa]
- Beta release of ias2xsuaa token exchange. Further information can be found here.
- Replaces dependencies to JSON Parser of
net.minidevwithorg.json(fixes #414).
- spring.boot.version 2.3.5.RELEASE --> 2.4.1
- spring.core.version 5.2.10.RELEASE --> 5.3.2
- spring.security.version 5.3.5.RELEASE --> 5.4.2
- [java-security]
getClientId()method was added toTokeninterface.getClientId()method should be used instead ofgetClaimAsString(TokenClaims.XSUAA.CLIENT_ID).TokenClaims.XSUAA.CLIENT_IDis deprecated.- Supports IAS token validation.
IAS_SERVICE_NAMEhas not be provided any longer. You can find a sample here.
- [java-security-test] In case you like to overwrite the client id using
JwtGeneratorusingwithClaimValue()orwithClaimValues()method, it's recommended to set theazpclaim instead usingwithClaimValue(TokenClaims.AUTHORIZATION_PARTY, "T000310"). - [spring-xsuaa]
getClientId()method implementation ofTokeninterface has been changed. Usingazpand as fallbackaudandcidclaims to obtain client id.
⚠️ backward incompatible change: usage of deprecated org.springframework.security.oauth:spring-security-oauth2 dependency inOAuth2AuthenticationConverterwas removed.OAuth2AuthenticationConverter.convert()method return type has changed fromorg.springframework.security.oauth2.provider.OAuth2Authenticationtoorg.springframework.security.oauth2.server.resource.authentication.BearerTokenAuthentication- Migration tips
- when necessary, org.springframework.security.oauth:spring-security-oauth2 dependency need to be provided explicitly
OAuth2WebSecurityExpressionHandler()won't work in conjunction withOAuth2AuthenticationConverter, as it expectsOAuth2Authenticationclass instead ofBearerTokenAuthenticationwhen deriving authorization claims. UsehasAuthority()orhasAnyAuthority()instead of explicitly definedexpressionHandler(new OAuth2WebSecurityExpressionHandler())andaccess()expression for authorized requests.
- Migration tips
- The following dependency was removed:
- org.springframework.security.oauth:spring-security-oauth2
- The following dependencies were updated:
- spring.boot.version 2.3.4.RELEASE --> 2.3.5.RELEASE
- spring.core.version 5.2.9.RELEASE --> 5.2.10.RELEASE
- spring.security.version 5.3.4.RELEASE --> 5.3.5.RELEASE
- caffeine.version 2.8.2 --> 2.8.6
- [java-security-test] Supports JUnit 5 Tests with
XsuaaExtension,IasExtensionandSecurityTestExtensionas documented here. - [spring-xsuaa-starter] Upgrade Spring versions:
- spring.boot.version: 2.3.1.RELEASE --> 2.3.4.RELEASE
- spring.core.version: 5.2.8.RELEASE --> 5.2.9.RELEASE
- The following dependencies were updated:
- Jetty 9.4.24.v20191120 --> 9.4.31.v20200723
- javax.servlet-api.version 3.0.1 --> 3.1.0
- Apache HTTP client 4.5.8 --> 4.5.9
- Wiremock 2.25.1 --> 2.27.2
- [java-security] Does not fail in case of Xsuaa services of type:
apiacess(#382).
- [spring-xsuaa] Update Spring versions
- spring.core.version: 5.2.7.RELEASE --> 5.2.8.RELEASE
- spring.security.version: 5.3.3.RELEASE --> 5.3.4.RELEASE
- [java-security-test]
SecurityTestandSecurityTestRuleprovides a better support for integration tests with a mockserver. It is now possible to upload the configuration and the token from a json file. Take our integration tests as a sample java-security-it. - [java-security]
DefaultJsonObject.getAsStringList(propertyName)parses the JSON object for a given property and returns aStringlist. This works also in case the property is not a JSON array but a JSON String. - [java-security-it] New integration test project. Existing integration tests have been restructured and moved here. Additionally, JWT token validation performance tests have been added for java-security and spring-xsuaa.
- Fixes
ClientCredentialsTokenFlow.scopes()andUserTokenFlow.scopes()to support multiple scopes. The scope form parameter has to provide a space-delimited list (and not comma-delimited list). - [java-security] Improve compatibility of
SAPOfflineTokenServicesCloud- There was incompatibility in the implementation of
SAPOfflineTokenServicesCloudthat caused theremoteUserof theHttpServletRequestto always return the client id of the XSUAA service binding. This was changed so that it now works like in the old implementation. This means that theremoteUsernow returns either theuser_nameclaim of the token for user tokens or the value of the client idcidclaim of the token for all other tokens (e.g. client tokens).
- There was incompatibility in the implementation of
- [java-api]
AcessTokenprovidesgetAttributeFromClaimAsString(String claimName, String attributeName)to access for exampleext_attrvalues such assubaccountidgetAttributeFromClaimAsStringList(String claimName, String attributeName)to access for examplexs.user.attributesvalues such ascustom_role
- [java-security] provide debug logs for failing token validation, see troubleshoot.
- [java-security-test] Fixed default value for jku token header to
http://localhost/token_keys - [samples] Upgraded approuter version to "^8.2.0"
- [spring-xsuaa-starter] Upgrade Spring versions:
- spring.boot.version: 2.3.0.RELEASE --> 2.3.1.RELEASE
- spring.core.version: 5.2.6.RELEASE --> 5.2.7.RELEASE
- spring.security.version: 5.3.2.RELEASE --> 5.3.3.RELEASE
- spring-security-oauth2.version: 2.4.1.RELEASE --> 2.5.0.RELEASE
- [java-security] Audience Validation validates to true when the derived
client_idof broker-clone token matches the trusted client. This is relevant to support tokens of grant typeuser_tokenthat contains no scopes.
- [java-security]
- Audience Validation is skipped when
client_idof token exactly matches the trusted client. This is relevant to support tokens of grant typeuser_tokenthat contains no scopes. - provides the subaccount identifier from the
ext_attrclaim.
- Audience Validation is skipped when
- [spring-xsuaa] provides the subaccount identifier from the
ext_attrclaim.
- [java-security]
- Audience Validation accepts tokens of grant type
user_tokenthat does not provideaudclaim. In that caseJwtAudienceValidatorderives the audiences from the scopes.
- Audience Validation accepts tokens of grant type
- Use
getSubaccountId()only to fetch the subaccount id, e.g. for calling the metering API for user-based pricing. - In case you are interested in the customers tenant GUID make use of
getZoneId()instead! - In upcoming releases - especially for new subaccounts - subaccount id will no longer match the tenant GUID which is provided via the xsuaa access token as
zidclaim or via the ias oidc token aszone_uuidclaim.
- [java-security]
XSUserInfoAdapterprovides now the subdomain that is required for token exchange viagetSubdomain()method.- Avoid warning messages "IAS Service is not yet supported!". #273
- rename Token claim "sap_uid" to „user_uuid“.
- Token Key Cache can now be customized via
XsuaaTokenAuthenticator. XSUserInfoAdaptersupportsrequestTokenForUser()method.- set validators to package private, you can customize the JWT validators using the
JwtValidatorBuilder. - Create validation results lazy. Avoid false warning validation results from
JwtAudienceValidator(#290), e.g.
Jwt token with audience [<appId>, uaa] is not issued for these clientIds: [<appId>].
- [spring-xsuaa] Improve logs of Audience Validators.
- [spring-xsuaa-starter] Upgrade Spring versions:
- spring.boot.version: 2.2.6.RELEASE --> 2.3.0.RELEASE
- spring.core.version: 5.2.5.RELEASE --> 5.2.6.RELEASE
- spring.security.version: 5.3.1.RELEASE --> 5.3.2.RELEASE
- spring.security.oauth2: 2.4.0.RELEASE -> 2.4.1.RELEASE
- [spring-xsuaa-test]
- renamed file
privateKey.txttospring-xsuaa-privateKey.txtandpublicKey.txttospring-xsuaa-publicKey.txtto avoid name clashes in context of CAP, which results in a strangeIllegalArgumentException:failed to construct sequence from byte[]: DEF length 1213 object truncated by 2. This can happen when you usejava-security-testandspring-xsuaa-testin parallel. - For new applications
spring-xsuaa-testcan be replaced in favor ofjava-security-testfor unit testing. For testing your app locally you can setup your local environment with theVCAP_SERVICESin order to test with your XSUAA instance on Cloud Foundry.
- renamed file
- [token-client]
- more detailed debug logs and details to exception; decoded token gets logged.
- supports optional
scopeparameter to reduce scopes that are provided viaCientCredentialsTokenFloworUserTokenFlow. - By default requested tokens are now cached. You can disable the cache globally or per request as described here.
- never log an encoded token! Instead you can log the
OAuth2TokenResponseitself: thetoString()method provides the content of the decoded token (clear text). Be aware that this contains sensitive user data.
- [token-client] By default requested tokens are now cached. You can disable the cache globally or per request as described here.
- [java-security]
XSUserInfoAdapterprovides now the subdomain that is required for token exchange viagetSubdomain()method.- Avoid warning messages "IAS Service is not yet supported!".
- [spring-xsuaa-test]
- renamed file
privateKey.txttospring-xsuaa-privateKey.txtandpublicKey.txttospring-xsuaa-publicKey.txtto avoid name clashes in context of CAP, which results in a strangeIllegalArgumentException:failed to construct sequence from byte[]: DEF length 1213 object truncated by 2. This can happen when you usejava-security-testandspring-xsuaa-testin parallel. - For new applications
spring-xsuaa-testcan be replaced in favor ofjava-security-testfor unit testing. For testing your app locally you can setup your local environment with theVCAP_SERVICESin order to test with your XSUAA instance on Cloud Foundry.
- renamed file
- [spring-xsuaa-starter] Upgrade Spring versions:
- spring.boot.version: 2.2.6.RELEASE --> 2.3.0.RELEASE
- spring.core.version: 5.2.5.RELEASE --> 5.2.6.RELEASE
- spring.security.version: 5.3.1.RELEASE --> 5.3.2.RELEASE
- spring.security.oauth2: 2.4.0.RELEASE -> 2.4.1.RELEASE
- [java-security]
XSUserInfoAdapterprovides full compatible implementation ofcom.sap.xsa.security.container.XSUserInfo.javainterface. Support token exchanges usingXsuaaTokenFlowsapi. - [spring-xsuaa] Improve support of multiple XSUAA Bindings as described here.
- [spring-xsuaa-starter] Upgrade Spring versions:
- spring.boot.version: 2.2.5.RELEASE --> 2.2.6.RELEASE
- spring.core.version: 5.2.4.RELEASE --> 5.2.5.RELEASE
- spring.security.version: 5.2.2.RELEASE --> 5.3.1.RELEASE
- [spring-xsuaa] SpringSecurityContext throws
AccessDeniedExceptioninstead ofIllegalStateExceptionwhen authentication does not contain principal of type Token. - [java-security]
JwtAudienceValidatorSupport Audience Validation of Xsuaa Broker clones (multiple xsuaa bindings): NGPBUG-111540. - [java-security-test] Basic support fo JUnit 5 (Jupiter).
- [java-security-test] Deprecation:
SecurityTestRule#getWireMockRule()needs to be replaced bygetWireMockServer(). - [java-security-test] One instance of
SecurityTestRuleshould run only one WireMock server. With that@ClassRule SecurityTestRulecan be declared in a base class.
- [spring-xsuaa]
XsuaaJwtDecodersupports verificationkey fromVCAP_SERVICESas fallback public key. - [spring-xsuaa] when using
auto-configurationand expose your ownRestTemplateRestOperationsbean, have a look at this documentation. - [java-security-test]
JwtGeneratorsupportswithLocalScopes(). - [java-security]
SapIdTokenshould return value of claim "sap_uid" (SAPGlobalUserID) as Principal name. - [java-security]
JwtAudienceValidatorSupport Audience Validation of Xsuaa Broker clones: NGPBUG-111540. - [java-api] enhanced with config interfaces, which are relevant for SAP Java Buildpack.
- [api] changes
XSUserInfoExceptionfromExceptiontoRuntimeException. This reflects the json-lib change injava-container-security(version3.12.0).
- [java-api], [java-security], [token-client] works with logger api
slf4j-apiand does no longer provide the slf4j-implementation. Please have a look at the java-security/README.md#logging documentation. - [xsuaa-spring-boot-starter] update spring-boot (security) dependency versions #239.
- [java-security-test]
SecurityTestRule.setKeysallows to customize private/public keys that are located in the resource path, e.g.src/main/resourcesorsrc/test/resources. - [java-security-test] configures the modulus of the public key provided by
WireMock. With that the public key can be consumed by the Nimbus Jwt decoder. - [samples/spring-security-xsuaa-usage] demonstrates how to setup JUnit tests using
java-security-testlibrary.
- [java-api] As preparation for the SAP Java Buildpack the interfaces, as well as the
SecurityContextis extracted to java-api. - [java-security]
AccessTokens provided via theSpringSecurityContextshould also support thehasLocalScopemethod.
- [java-security-test]
JwtGenerator.withClaimsFromFileaccepts claims from a file. - [java-security] Provides with
SpringSecurityContextan alternative way of accessing jwt tokens for Spring applications in asynchronous threads. - [token-client] The
UserTokenFlowhas used the "user_token" grant type together with the "refresh_token" grant type in order to do the token exchange. After the consumption of UAA 4.27 we can adapt the grant type "urn:ietf:params:oauth:grant-type:jwt-bearer". This reduces the round trips to the XSUAA from 2 to 1. Further, it eliminates the need for the user to have scope "uaa.user". The feature flagxsuaa.userTokenFlow.useJwtBearerhas become obsolete.
- [java-security] Initial / released version of the new plain Java security libraries as documented here.
- [spring-xsuaa] Fix vulnerability issues and increased Spring versions.
- [spring-xsuaa] Bug fix in TokenBrokerResolver: Second configured authentication method was ignored.
- Issue: Spring tests fail with version
2.2.0, when auto-configuration is disabled and noRestOperationsbean is specified. - [token-client] Supports basically JWT Bearer Token Grant as documented here.
- [token-client] Bug fix for state issue in HttpHeaderFactor (#200) that causes interference between different types of token flows.
- [spring-xsuaa] xsuaa bindings of plan
apiaccessdoes not cause an error, as they get ignored for token validation.
- [spring-xsuaa]
PropertySourceFactorysupports custom property sources and default can optionally be disabled withspring.xsuaa.disable-default-property-source=true - [spring-xsuaa] Supports Spring Core
5.2.0.RELEASEand Spring Boot2.2.0.RELEASE - [spring-xsuaa] Deprecates
TokenUrlUtilsin favor ofOAuth2ServiceEndpointsProvider - Internally, we've cleaned up maven dependencies (converged versions) and
- removed transient dependency of
spring-security-oauth2tojackson. - introduced
org.owasp.dependency-check-mavenwhich performs CVSS checks.
- removed transient dependency of
- [token-client] Supports password token flows as documented here.
token-clientlibrary supports Apache Http Client (without any Spring dependencies). Have also a look at the java-tokenclient-usage sample application.- Fix CVE-2018-1000613 by removing unnecessary dependencies (issue 144).
- Makes
XsuaaMockWebServermore robust.
- Deleted package
com.sap.xs2.security.containerin order to avoid Class Loader issues, when an application makes use of SAP-libraries using the SAP-internal container lib like CAP.- As already mentioned use
SpringSecurityContextclass instead ofSecurityContextclass.
- As already mentioned use
- Removed deprecated methods:
XsuaaServiceConfiguration.getTokenUrl()XsuaaToken.getClaimAccessor()is not required anymore asXsuaaitself implementsJwtClaimAccessor.
- Deprecated
TokenBrokerinterface and its implementationUaaTokenBroker, as this is going to be replaced with theOAuth2TokenServiceinterface which is provided by the newtoken-clientlibrary. If you wish to configure / pass yourRestTemplateyou can pass an instance ofOAuth2TokenService:
new TokenBrokerResolver(
<<your configuration>>,
<<your cache>>,
new XsuaaOAuth2TokenService(<<your restTemplate>>),
<<your authenticationInformationExtractor>>);TokenUlrUtilsclass is now package protected and will be deleted with version.token-clientlibrary supports basically Password-Grant Access Tokens.
-
We now provide a new slim
token-clientlibrary with aXsuaaTokenFlowsclass, which serves as a factory for the different flows (user, refresh and client-credentials). This deprecates the existingToken.requestToken(XSTokenRequest)API.- The
token-clientlibrary can be used by plain Java applications. - Auto-configuration is provided for Spring Boot applications only, when using XSUAA Spring Boot Starter.
- The
-
ANNOUNCEMENT: Please be aware that with version
2.0.0we want to get rid of packagecom.sap.xs2.security.containerin order to avoid Class Loader issues, when an application makes use of SAP-libraries using the SAP-internal container lib.
- Provides spring starter for spring-xsuaa, which enables auto-configuration
- Supports reactive ServerHttpSecurity (Spring webflux). Have a look at the (webflux sample application)[samples/spring-webflux-security-xsuaa-usage/README.md]
- Some enhancements for XSUAA integration
- To make sure that the Spring SecurityContext is always initialized with a validated token use
SpringSecurityContext.init()method as documented here - Use
SpringSecurityContextinstead ofSecurityContext, which gets deprecated in this version.
- As of version
1.6.0you need to make use of XSUAA Spring Boot Starter in order to leverage auto-configuration (see "Troubleshoot" section here)
- Supports
jkuURI which is provided as part of the JSON Web Signature (JWS). Thejkuof the Jwt token header references the public key URI of the Xsuaa OAuth Authorization Server, and needs to match to thexsuaa.uaadomain. - Completely customizable auto-configurations so that apps can override the spring-xsuaa defaults:
- Uses apache slf4j Logger for better log analysis on Cloud Foundry. This is provided with org.springframework.boot:spring-boot-starter-logging.
- Improves and enhances sample application.
- Renames class
TokenImpltoXsuaaToken. Furthermore for convenienceXsuaaTokensubclassesorg.springframework.security.oauth2.jwt.Jwt. - Subclassing of
TokenAuthenticationConverteris no longer allowed, insteadTokenAuthenticationConvertercan be configured with your ownAuthoritiesExtractorimplementation (an example can be found here). - Please note that the port of the mock web server that is provided with the xsuaa mock library had to be defined statically. It runs now always on port 33195.
- Find more complex examples here: https://github.com/SAP/cloud-application-security-sample
- API method to query token validity
- Bugfix in basic authentication support: allow usage of JWT token or basic authentication with one configuration
- Allows overwrite / enhancement of XSUAA jwt token validators
- Allow applications to initialize of Spring SecurityContext for non HTTP requests. As documented here
- Broker plan validation failed due to incorrect audience validation
- JwtGenerator offers enhancement options: custom claims and audience
- Test framework support for multi tenancy
- Eases enhancement of TokenAuthenticationConverter (issue 23)
- Makes XsuaaAudienceValidator more robust (issue 21)
- XSTokenRequest accepts custom RestTemplate (issue 25)
- Provides spring-xsuaa-test library with JWTGenerator (issue 29)
- Provides spring-xsuaa-mock library with XSUAA authentication mock web server for offline token key validation (issue 30)
- Spring-Security 5 integration libraries. Added AudienceValidator
- Spring-Security 5 Support for basic authentication
- Initial version including spring-security 5 integration libraries
- Initial version of the api for SAP Java Buildpack