gentle-bird-90474
02/24/2023, 1:51 PM.well-known/openid-configuration
endpoint. This fails due to CORS constraints.
We’ve tried to enable CORS in the Ory Console under “OAUTH2 > Configuration” but there is no UI functionality to do so. Therefore, we’ve
• downloaded the config via ory get project --format json $PROJECT_ID > $CFG_FILE
,
• edited the JSON config value serve.public.cors.enabled
, and
• updated the config via ory update oauth2-config --format json $PROJECT_ID --file $CFG_FILE
Ory Console still shows it CORS being disabled and doing a simple curl
to the .well-known/openid-configuration
does not show any Access-Control-Allow-Origin
headers. Could you help?gentle-bird-90474
02/24/2023, 1:53 PMhigh-optician-2097
gentle-bird-90474
02/24/2023, 1:58 PMgentle-bird-90474
02/24/2023, 1:59 PMcurl -v <https://auth.project-holi.org/.well-known/openid-configuration>
high-optician-2097
high-optician-2097
gentle-bird-90474
02/24/2023, 2:08 PMAccess-Control-Allow-Origin
headers just with the curl
command above but it seems those headers depend on the concrete query sent to Ory.gentle-bird-90474
02/24/2023, 2:08 PMhigh-optician-2097
gentle-bird-90474
02/24/2023, 2:31 PM/oauth2/token
endpoint. Checking the token, it does in fact seems like it has an invalid signature. Any idea?high-optician-2097
gentle-bird-90474
02/24/2023, 2:42 PMid_token
from the response and paste it into jwt.io, it should show me that the signature is valid, right?gentle-bird-90474
02/24/2023, 2:43 PMgentle-bird-90474
02/24/2023, 2:44 PMfailed to verify access token: token contains an invalid number of segments
.gentle-bird-90474
02/24/2023, 3:02 PMNot sure what you mean by opaque vs jwt, thoughAh, I see. No, the token we receive definitely is (or claims to be) a JWT token. I can decode it:
$ jq -R 'split(".") | .[0],.[1] | @base64d | fromjson' <<< $TOKEN
{
"alg": "RS256",
"kid": "eb5753b3-fc18-4142-a734-c5584be8bac3",
"typ": "JWT"
}
{
... (sensible data)
}
high-optician-2097
gentle-bird-90474
02/24/2023, 3:53 PMaccess_token
from the response, NOT the id_token
. It fails parsing it as a JWT token, because, in fact, it is no JWT token but a string starting with ory_at_2ChNVZud….
.gentle-bird-90474
02/24/2023, 4:06 PMgentle-bird-90474
02/24/2023, 4:36 PMaccess_token
. It now fails the validation due to the iss
field being set to `flamboyant-hopper-h35q…`(the project slug) while OwnCloud is expecting the custom domain (<http://auth.project-holi.org|auth.project-holi.org>
).
The problem is: we can only use <http://auth.project-holi.org|auth.project-holi.org>
because only for the custom domain CORS works. Using the project slug-based domain, CORS stops working and therefore the whole SSO process doesn’t even start.
Is there a way to e.g. have the custom domain in the iss
field of the token? Couldn’t find anything in the documentation.gentle-bird-90474
02/24/2023, 4:38 PMhigh-optician-2097
high-optician-2097
high-optician-2097
high-optician-2097
ory patch oauth2-config --replace '/urls/self/issuer="<https://yourcname>"'
high-optician-2097
gentle-bird-90474
02/24/2023, 6:29 PM