cancel
Showing results for 
Search instead for 
Did you mean: 

Invalid redirect https://bookstore did not match one of the registered values

davecor
Explorer
0 Kudos

Following exacly the bookshop tutorial (https://developers.sap.com/tutorials/cp-cap-java-security-cf.html) I retrieve this error in my authentication step.

My xs-security.json

{
"xsappname": "bookstore",
"tenant-mode": "dedicated",
"scopes": [
{
"name": "$XSAPPNAME.Administrators",
"description": "Administrators"
}
],
"attributes": [],
"role-templates": [
{
"name": "Administrators",
"description": "generated",
"scope-references": [
"$XSAPPNAME.Administrators"
],
"attribute-references": []
}
],
"role-collections": [
{
"name": "BookStore_Administrators",
"description": "BookStore Administrators",
"role-template-references": ["$XSAPPNAME.Administrators"]
}
],
"oauth2-configuration": {
"redirect-uris": ["https://api.cf.us10-001.hana.ondemand.com"]
}
}
How can I solve it?

Accepted Solutions (0)

Answers (2)

Answers (2)

davecor
Explorer
0 Kudos

Thanks a lot to answer me, but I tried with:

  "oauth2-configuration": {
"redirect-uris": ["https://*.us10-001.hana.ondemand.com"]
}
and
  "oauth2-configuration": {
"redirect-uris": ["https://*.us10-001.hana.ondemand.com/**"]
}
But I receive from postman in Auth2 request this error:Invalid redirect https://xxxxxxxx-xxxxxxx-xxxxxxxx-by.cfapps.us10-001.hana.ondemand.com did not match one of the registered values
torstenluh
Discoverer
0 Kudos

davecor Please check the following documentation:
https://help.sap.com/docs/btp/sap-business-technology-platform/security-considerations-for-sap-autho...

Specifically, "Set the redirect-uris property to restrict access as much as possible.".

yogananda
Product and Topic Expert
Product and Topic Expert
0 Kudos

davecor

Issue was in line redirect-uri.. you can consider the below and try it ..

redirect-uris": ["https://*.us10-001.hana.ondemand.com"]
{
"xsappname": "bookstore",
"tenant-mode": "dedicated",
"scopes": [
{
"name": "$XSAPPNAME.Administrators",
"description": "Administrators"
}
],
"attributes": [],
"role-templates": [
{
"name": "Administrators",
"description": "generated",
"scope-references": [
"$XSAPPNAME.Administrators"
],
"attribute-references": []
}
],
"role-collections": [
{
"name": "BookStore_Administrators",
"description": "BookStore Administrators",
"role-template-references": ["$XSAPPNAME.Administrators"]
}
],
"oauth2-configuration": {
"redirect-uris": ["https://*.us10-001.hana.ondemand.com"]
}
}