Skip to content

Commit ce2078e

Browse files
authored
Configure OAuth2 Redirect URI for XSUAA Login (#235)
This is now mandatory on some landscapes, otherwise login fails. It is also recommended by XSUAA here: https://help.sap.com/docs/btp/sap-business-technology-platform/security-considerations-for-sap-authorization-and-trust-management-service
1 parent 1b92fc3 commit ce2078e

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

mta-multi-tenant.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ modules:
7272
disk-quota: 512M
7373
keep-existing-routes: true
7474
properties:
75-
TENANT_HOST_PATTERN: ^(.*)-${default-uri}
75+
TENANT_HOST_PATTERN: ^(.*)-${default-uri} # testing only, use custom domain with wildcard for production
7676
requires:
7777
- name: srv-api
7878
group: destinations
@@ -86,6 +86,7 @@ modules:
8686
- name: app-api
8787
properties:
8888
app-url: '${default-url}'
89+
app-domain: '${domain}'
8990
# --------------------- RESOURCES ---------------------
9091
resources:
9192
# -----------------------------------------------------
@@ -97,6 +98,11 @@ resources:
9798
path: ./xs-security-mt.json
9899
config: # override xsappname as it needs to be unique
99100
xsappname: bookshop-mt-${org}-${space}
101+
oauth2-configuration:
102+
redirect-uris:
103+
- https://*.~{app-api/app-domain}/**
104+
requires:
105+
- name: app-api
100106
- name: bookshop-mt-service-manager
101107
type: org.cloudfoundry.managed-service
102108
parameters:

mta-single-tenant.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,10 @@ modules:
6363
forwardAuthToken: true
6464
strictSSL: true
6565
- name: bookshop-uaa
66+
provides:
67+
- name: app-api
68+
properties:
69+
app-url: '${default-url}'
6670
# --------------------- RESOURCES ---------------------
6771
resources:
6872
# -----------------------------------------------------
@@ -74,6 +78,11 @@ resources:
7478
path: ./xs-security.json
7579
config: # override xsappname as it needs to be unique
7680
xsappname: bookshop-${org}-${space}
81+
oauth2-configuration:
82+
redirect-uris:
83+
- ~{app-api/app-url}/**
84+
requires:
85+
- name: app-api
7786
- name: bookshop-hdi-container
7887
type: org.cloudfoundry.managed-service
7988
parameters:

0 commit comments

Comments
 (0)