Skip to content

Commit

Permalink
Merge tag 'v75.6.0'
Browse files Browse the repository at this point in the history
* tag 'v75.6.0':
  Update UAA image reference in k8s deployment template to 75.6.0
  Bump k8s.io/client-go from 0.21.3 to 0.22.0 in /k8s (cloudfoundry#1639)
  Bump k8s.io/api from 0.21.3 to 0.22.0 in /k8s (cloudfoundry#1638)
  fix generateDocs
  PKCE support in IDP (OIDC) proxy authorization flow (cloudfoundry#1606)
  fix: upgrade org.springframework.security.oauth:spring-security-oauth2 from 2.4.0.RELEASE to 2.5.1.RELEASE (cloudfoundry#1632)
  fix: upgrade org.passay:passay from 1.2.0 to 1.6.0 (cloudfoundry#1633)
  Do not expire invitations on GET requests (cloudfoundry#1128)
  revert back
  revert to last working
  fix bundle install
  update (cloudfoundry#1627)
  update kramdown 2.3.1 (cloudfoundry#1626)
  Fix bug with origin chooser and selected allowed provider configuration
  update activesupport 5.2.4.3 (cloudfoundry#1625)
  update jquery (cloudfoundry#1618)
  Update Font-Awesome (cloudfoundry#1617)
  Bump commons-io from 2.10.0 to 2.11.0 (cloudfoundry#1616)
  rebase
  rebase
  merge develop
  Bump passay version 1.6.1 (cloudfoundry#1612)
  Bump Spring Dependencies (cloudfoundry#1611)
  Bump k8s.io/client-go from 0.21.2 to 0.21.3 in /k8s (cloudfoundry#1609)
  Bump k8s.io/apimachinery from 0.21.2 to 0.21.3 in /k8s (cloudfoundry#1608)
  Add workaround for revoke access dialog from issue cloudfoundry#1036 (cloudfoundry#1254)
  Bump spring oauth2 version to 2.5.1.RELEASE (cloudfoundry#1601)
  Bump addressable from 2.5.0 to 2.8.0 in /uaa/slate (cloudfoundry#1603)
  Add property option for mail.smtp.ssl.protocols (cloudfoundry#1605)
  Add property option for mail.smtp.ssl.protocols (cloudfoundry#1604)
  Fix CF-UAA version number
  Bump maven dependencies (cloudfoundry#1600)
  Bump Tomcat dependency
  Bump github.com/onsi/gomega from 1.13.0 to 1.14.0 in /k8s (cloudfoundry#1599)
  cleanup code from sonar findings and add additional tests
  cleanup code from sonar findings and add additional tests
  More test parameters for UaaUrlUtils.findMatchingRedirectUri() tests
  fix: Open Redirect Security Issue via some UAA endpoints, including logout.do
  BigInteger encoding fixed (cloudfoundry#1579)
  Set startStopTimeout to be configurable (cloudfoundry#1594)
  switch to StaleUrlCache
  origin sync
  Bump jasmine-core from 3.7.1 to 3.8.0 in /uaa (cloudfoundry#1598)
  Bump jasmine from 3.7.0 to 3.8.0 in /uaa (cloudfoundry#1597)
  Bump dependency (cloudfoundry#1596)
  Performance optimation: Prevent expensive duplicate key exception and use upsert instead (cloudfoundry#1562)
  Refactor: query minimal user information everywhere authorities not needed (cloudfoundry#1322)
  Allow to use Account Chooser without Idp Discovery (cloudfoundry#1550)
  Bump k8s.io/client-go from 0.21.0 to 0.21.2 in /k8s (cloudfoundry#1586)
  Bump commons-io from 2.7 to 2.10.0 (cloudfoundry#1582)
  Update dependencies.gradle
  update
  Create dependencies.gradle
  cleanup PR - remove orphan class - use new class in all tests - dependency cosmetics
  Bump k8s.io/api from 0.21.0 to 0.21.2 in /k8s (cloudfoundry#1585)
  Bump github.com/onsi/gomega from 1.11.0 to 1.13.0 in /k8s (cloudfoundry#1573)
  Bump github.com/onsi/ginkgo from 1.16.1 to 1.16.4 in /k8s (cloudfoundry#1575)
  Bump k8s.io/apimachinery from 0.21.0 to 0.21.2 in /k8s (cloudfoundry#1587)
  Github userUserInfo from local configuration (cloudfoundry#1595)
  Add '-Xdebug' jvm args to application container run in cargo if '-Dxdebug=true' option is sepcified for 'gradle run'. (cloudfoundry#1592)
  Bump Guava Dependencies (cloudfoundry#1581)
  Document the 'userInfoUrl' property for OAuth identity provider config
  Bump Spring Dependencies (cloudfoundry#1591)
  Fix issue 1584
  Test that we redirect when client allows only SAML
  Backfill test cases for using refresh token value that was created with refresh_token_validity seconds specified [#178076368]
  Bump Spring Dependencies (cloudfoundry#1580)
  fix: test token audience claim in an unordered way
  Bump Spring Dependencies (cloudfoundry#1577)
  Bump bouncyCastleVersion from 1.68 to 1.69
  Small improvements for the consent form (cloudfoundry#1561)
  Use Claims class to desrialize the token string.
  feat: output message when DB cannot be initialized
  refactor: extract variable
  formatting: whitespaces
  do not sleep more than 1 minute
  fix: test runner flakes
  fix: authTime can be later than 2037
  Bump nokogiri from 1.11.0 to 1.11.4 in /uaa/slate
  Backfilled unit test
  Make Java 11 our minimum
  Additional test cases to verify that ldap bindSecret is not included in the response for the CVE issue where the delete-identity-provider response contained sensitive data #178139149 (cloudfoundry#1572)
  Adjust unit test to new constructor signature, after rebasing on top of the 'develop' branch
  Share common 'userInfoUrl' property between OIDC and OAuth2 config + Use it to fetch OAuth2 user info
  Various code/spaces improvements
  Implement support for Github OAuth 2.0 provider
  feat: error log on internal error
  feat: validate java version
  Fixed the CVE issue where the delete-identity-provider response contains relyingPartySecret value #178139149
  Fix comment
  Include passcode prompt in json response if discovery or account chooser are enabled
  Bump bcprov-jdk15on from 1.66 to 1.67 in /server (cloudfoundry#1564)
  Update UAA image reference in k8s deployment template to cloudfoundry/uaa@sha256:4c7f2d881bc9c4a075232064e906d032c9512b03b87c06cbb2501560cb2f14e4
  Return existing records on update failure
  Restore explicit imports.
  login_hint should not automatically bypass discovery logic
  Bump tomcat-embed-core from 9.0.37 to 9.0.45 in /samples/api (cloudfoundry#1544)
  Bump tomcat-embed-core from 9.0.37 to 9.0.45 in /samples/app (cloudfoundry#1546)
  Bump tomcat-embed-core from 9.0.37 to 9.0.45 in /server (cloudfoundry#1545)
  Bump tomcat-embed-core from 9.0.37 to 9.0.45 in /statsd (cloudfoundry#1547)
  Bump jasmine-core from 3.6.0 to 3.7.1 in /uaa
  Bump jasmine from 3.6.4 to 3.7.0 in /uaa
  Bump k8s.io/client-go from 0.20.5 to 0.21.0 in /k8s
  Bump k8s.io/apimachinery from 0.20.5 to 0.21.0 in /k8s
  Bump github.com/onsi/ginkgo from 1.15.2 to 1.16.1 in /k8s
  Bump Spring Dependencies (cloudfoundry#1559)
  refactor: extract shared code into helper methods
  Rename variable and test case for clarity
  Invert boolean method to have a more intuitive naming
  Add additional tests
  Only update user if token not issued by UAA
  Fix wrong username mapping on jwt Bearer with UAA token
  Bump tomcat-embed-core from 9.0.37 to 9.0.44 in /uaa (cloudfoundry#1548)
  Bump k8s.io/client-go from 0.20.2 to 0.20.5 in /k8s (cloudfoundry#1541)
  Bump github.com/onsi/ginkgo from 1.14.2 to 1.15.2 in /k8s (cloudfoundry#1535)
  Bump k8s.io/api from 0.20.2 to 0.20.5 in /k8s (cloudfoundry#1542)
  refactor: rename
  Bump github.com/onsi/gomega from 1.10.4 to 1.11.0 in /k8s (cloudfoundry#1532)
  Dependeny Updagtes (cloudfoundry#1538)
  refactor: implement recommendation from thymeleaf (cloudfoundry#1512)
  Fix typo
  feat: for unit tests, add time out to waiting for DB to start
  Update UAA image reference in k8s deployment template to cloudfoundry/uaa@sha256:7fd48f08134e279a4fe2b8a200ecfdca8cda847175df38f1293e9818d7dd53cc
  Bump dependency
  Update UAA image reference in k8s deployment template to cloudfoundry/uaa@sha256:c1d54700f1e6b8fabe49917a8e4ca59f381a11c69982439525f9af8a08f29e0c
  Add MockMvc Test to show performance improvement
  Fix bug with invalid login_hint on login page
  Move read configurations and parameters to allow earlier decisions
  Restructure login method to not read all IdentityProviders on login_hint
  Update UAA image reference in k8s deployment template to cloudfoundry/uaa@sha256:37fcf63a156b75174fbc7be0e3809d64cda6851de0bfe6fa7f12793d919de96a
  Added "final" modifier for method-local constant
  better name for matches function
  capitilize first letter of log sentence
  meaningful name for number of url-decode attempts
  javadoc explaining integrity bypass fix
  fix double dot path traversal integrity check bypass
  redirect resolver tests should cover path traversal bypass for both registered paths containing wildcards and those that do not
  unit tests for redirect_uri path integrity check bypass
  add lombok dependency
  Add PKCE support
  • Loading branch information
akarollil committed Aug 5, 2021
2 parents 1cc0557 + ebc061d commit a2fe14d
Show file tree
Hide file tree
Showing 166 changed files with 10,542 additions and 1,898 deletions.
11 changes: 10 additions & 1 deletion build.gradle
Expand Up @@ -149,6 +149,10 @@ cargo {
containerId = "tomcat9x"
port = applicationPort

if (JavaVersion.current() < JavaVersion.VERSION_11) {
throw new GradleException("This build must be run with Java version [ " + JavaVersion.VERSION_11 + " ] or greater. Your Java version is [ " + JavaVersion.current() + " ]")
}

deployable {
file = file("samples/api/build/libs/cloudfoundry-identity-api-" + version + ".war")
context = "api"
Expand All @@ -166,7 +170,7 @@ cargo {

local {
configHomeDir = file(Paths.get(System.getProperty("java.io.tmpdir") + "/uaa-${applicationPort}"))
startStopTimeout = 540000
startStopTimeout = Integer.parseInt(System.getProperty("startStopTimeout", "540000"))
rmiPort = applicationPort + 10

jvmArgs = ""
Expand All @@ -176,6 +180,11 @@ cargo {
if (System.getProperty("spring.profiles.active", "").split(',').contains("debug")) {
jvmArgs = String.format("%s -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005", jvmArgs)
}
else if (Boolean.valueOf(System.getProperty("xdebug"))) {
jvmArgs = String.format("%s -Xdebug " +
"-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005 " +
"-Xnoagent -Djava.compiler=NONE", jvmArgs)
}

outputFile = file("uaa/build/reports/tests/uaa-server.log")
configFile {
Expand Down
19 changes: 11 additions & 8 deletions dependencies.gradle
Expand Up @@ -10,15 +10,16 @@ ext["flyway.version"] = "5.2.4"
// Versions shared between multiple dependencies
versions.aspectJVersion = "1.9.4"
versions.apacheDsVersion = "2.0.0.AM26"
versions.bouncyCastleVersion = "1.68"
versions.bouncyCastleVersion = "1.69"
versions.hamcrestVersion = "2.2"
versions.springBootVersion = "2.4.2"
versions.springBootVersion = "2.4.9"
versions.springSecurityJwtVersion = "1.1.1.RELEASE"
versions.springSecurityOAuthVersion = "2.5.0.RELEASE"
versions.springSecurityOAuthVersion = "2.5.1.RELEASE"
versions.springSecuritySamlVersion = "1.0.10.RELEASE"
versions.springVersion = "5.3.3"
versions.springVersion = "5.3.9"
versions.xmlBind = "2.3.0.1"
versions.tomcatCargoVersion = "9.0.41"
versions.tomcatCargoVersion = "9.0.50"
versions.guavaVersion = "30.1.1-jre"

// Dependencies (some rely on shared versions, some are shared between projects)
libraries.apacheCommonsRngCore = "org.apache.commons:commons-rng-core:1.3"
Expand All @@ -31,13 +32,14 @@ libraries.aspectJWeaver = "org.aspectj:aspectjweaver"
libraries.beanutils = "commons-beanutils:commons-beanutils:1.9.4"
libraries.bouncyCastlePkix = "org.bouncycastle:bcpkix-jdk15on:${versions.bouncyCastleVersion}"
libraries.bouncyCastleProv = "org.bouncycastle:bcprov-jdk15on:${versions.bouncyCastleVersion}"
libraries.commonsIo = "commons-io:commons-io:2.7"
libraries.commonsIo = "commons-io:commons-io:2.11.0"
libraries.dumbster = "dumbster:dumbster:1.6"
libraries.eclipseJgit = "org.eclipse.jgit:org.eclipse.jgit:5.8.0.202006091008-r"
libraries.flywayCore = "org.flywaydb:flyway-core"
libraries.greenmail = "com.icegreen:greenmail:1.5.11"
libraries.googleAuth = "com.warrenstrange:googleauth:1.5.0"
libraries.guava = "com.google.guava:guava:30.0-jre"
libraries.guava = "com.google.guava:guava:${versions.guavaVersion}"
libraries.guavaTestLib = "com.google.guava:guava-testlib:${versions.guavaVersion}"
libraries.hamcrest = "org.hamcrest:hamcrest:${versions.hamcrestVersion}"
libraries.hibernateValidator = "org.hibernate.validator:hibernate-validator"
libraries.hsqldb = "org.hsqldb:hsqldb"
Expand All @@ -63,7 +65,7 @@ libraries.lombok = "org.projectlombok:lombok"
libraries.mariaJdbcDriver = "org.mariadb.jdbc:mariadb-java-client"
libraries.mockito = "org.mockito:mockito-core"
libraries.mockitoJunit5 = "org.mockito:mockito-junit-jupiter"
libraries.passay = "org.passay:passay:1.6.0"
libraries.passay = "org.passay:passay:1.6.1"
libraries.postgresql = "org.postgresql:postgresql"
libraries.selenium = "org.seleniumhq.selenium:selenium-java"
libraries.slf4jApi = "org.slf4j:slf4j-api"
Expand Down Expand Up @@ -110,6 +112,7 @@ libraries.unboundIdLdapSdk = "com.unboundid:unboundid-ldapsdk"
libraries.unboundIdScimSdk = "com.unboundid.product.scim:scim-sdk:1.8.24"
libraries.velocity = "org.apache.velocity:velocity-engine-core:2.2"
libraries.zxing = "com.google.zxing:javase:3.4.0"
libraries.nimbusJwt = "com.nimbusds:nimbus-jose-jwt"

// gradle plugins
libraries.asciidoctorGradlePlugin = "org.asciidoctor:asciidoctor-gradle-plugin:1.6.1"
Expand Down
46 changes: 46 additions & 0 deletions docs/github-oauth2-provider.md
@@ -0,0 +1,46 @@
# Registering Github as external OAuth provider in UAA

Github can be setup as an Oauth2 provider for UAA.

1. Create an OAuth “application” client in Github.
For example at: `https://github.com/organizations/{YOUR-ORG}/settings/applications/new`.

Add following URI in the “_Authorization callback URL_” text field:
`http://{UAA_HOST}/login/callback/{origin}`. Additional Github
documentation for achieving this can be found here:
[Creating an OAuth App](https://docs.github.com/en/free-pro-team@latest/developers/apps/creating-an-oauth-app)
[Authorizing OAuth Apps](https://docs.github.com/en/free-pro-team@latest/developers/apps/authorizing-oauth-apps)

2. Make sure you have `Client ID` and `Client secret`.

3. The following configuration needs to be added in login.yml.
Please refer to 'https://accounts.google.com/.well-known/openid-configuration' for authUrl and tokenUrl

login:
oauth:
providers:
github:
type: oauth2.0
providerDescription: Github OAuth provider, using the 'Authorization Code Grant' flow
authUrl: https://github.com/login/oauth/authorize
tokenUrl: https://github.com/login/oauth/access_token
userInfoUrl: https://api.github.com/user
scopes:
- read:user
- user:email
linkText: Login with Github
showLinkText: true
addShadowUserOnLogin: true # users won't need to be pre-populated into the UAA database prior to authenticating with Github
relyingPartyId: REPLACE_WITH_CLIENT_ID
relyingPartySecret: REPLACE_WITH_CLIENT_SECRET
skipSslValidation: false
clientAuthInBody: true
attributeMappings:
given_name: login
family_name: name # Github doesn't split 'given_name' and 'family_name'
user_name: email

4. Ensure that the scope `email` is included in the`scopes` property. Without
this, UAA will not be able to identify the authenticated user.

5. Restart UAA. You will see `Login with github` link on your login page.
33 changes: 33 additions & 0 deletions docs/okta-public-oidc-provider.md
@@ -0,0 +1,33 @@
# Registering Okta as external, public OIDC provider in UAA

Okta can be setup as an [OIDC provider](https://developer.okta.com/docs/guides/add-an-external-idp/openidconnect/configure-idp-in-okta/) for UAA login.
In order to prevent storing a client secret in UAA configuration and all of it's successor problems like secret rotation and so on, register the
external OIDC provider with a public client.

1. Create an OIDC application and set it with [PKCE public](https://developer.okta.com/blog/2019/08/22/okta-authjs-pkce#use-pkce-to-make-your-apps-more-secure).
Register the "Redirect URIs" in the application section "OpenID Connect Configuration"

Add following URI in list field:
`http://{UAA_HOST}/login/callback/{origin}`. [Additional documentation for achieving this can be found here](https://developer.okta.com/docs/guides/implement-auth-code-pkce/overview/).

2. Copy client id.

3. Minimal OIDC configuration needs to be added in login.ym.
Read configuration refer to 'https://<your-tenant>.okta.com/.well-known/openid-configuration' for discoveryUrl and issuer

login:
oauth:
providers:
okta.public:
type: oidc1.0
discoveryUrl: https://trailaccount.okta.com/.well-known/openid-configuration
issuer: https://trailaccount.okta.com
scopes:
- openid
linkText: Login with Okta-Public
showLinkText: true
relyingPartyId: 0iak4aiaC4HV39L6g123

4. Ensure that the scope `openid` is included in the`scopes` property.

5. Restart UAA. You will see `Login with Okta-Public` link on your login page.
36 changes: 36 additions & 0 deletions docs/sap-public-oidc-provider.md
@@ -0,0 +1,36 @@
# Registering SAP IAS as external, public OIDC provider in UAA

SAP IAS can be setup as an [OIDC provider](https://help.sap.com/viewer/6d6d63354d1242d185ab4830fc04feb1/Cloud/en-US/a789c9c8c0f5439da8c30b5d9e43bece.htm) for UAA login.
In order to prevent storing a client secret in UAA configuration and all of it's successor problems like secret rotation and so on, register the
external OIDC provider with a public client.

1. Create an OIDC application and set it with [type public](https://help.sap.com/viewer/6d6d63354d1242d185ab4830fc04feb1/Cloud/en-US/a721157cd40544eb9bad40085cf8ec15.html).
Register the "Redirect URIs" in the application section "OpenID Connect Configuration"

Add following URI in list field:
`http://{UAA_HOST}/login/callback/{origin}`. [Additional documentation for achieving this can be found here](https://help.sap.com/viewer/6d6d63354d1242d185ab4830fc04feb1/Cloud/en-US/1ae324ee3b2d4a728650eb022d5fd910.html).

2. Copy client id.

3. Minimal OIDC configuration needs to be added in login.ym.
Read configuration refer to '[https://<tenant ID>.accounts.ondemand.com/.well-known/openid-configuration](https://help.sap.com/viewer/6d6d63354d1242d185ab4830fc04feb1/Cloud/en-US/c297516bae4547eb82eeed80fea2b937.html)' for discoveryUrl and issuer

login:
oauth:
providers:
ias.public:
type: oidc1.0
discoveryUrl: https://trailaccount.accounts.ondemand.com/.well-known/openid-configuration
issuer: https://trailaccount.accounts.ondemand.com
scopes:
- openid
- email
- profile
linkText: Login with IAS-Public
showLinkText: true
relyingPartyId: 3feb7ecb-d106-4432-b335-aca2689ad123

4. Ensure that the scope `openid`, `email` and `profile` is included in the`scopes` property. Then UAA shadow user (if addShadowUserOnLogin=true) is created
with all properties.

5. Restart UAA. You will see `Login with IAS-Public` link on your login page.
10 changes: 5 additions & 5 deletions k8s/go.mod
Expand Up @@ -3,10 +3,10 @@ module github.com/cloudfoundry/uaa
go 1.15

require (
github.com/onsi/ginkgo v1.14.2
github.com/onsi/gomega v1.10.4
github.com/onsi/ginkgo v1.16.4
github.com/onsi/gomega v1.14.0
gopkg.in/yaml.v2 v2.4.0
k8s.io/api v0.20.2
k8s.io/apimachinery v0.20.2
k8s.io/client-go v0.20.2
k8s.io/api v0.22.0
k8s.io/apimachinery v0.22.0
k8s.io/client-go v0.22.0
)

0 comments on commit a2fe14d

Please sign in to comment.