i had oauth2 flow running but suddenly now it's no...
# talk-hydra
f
i had oauth2 flow running but suddenly now it's not working on android browses, i'm getting this error, when i run the exact flow on desktop browser on computer, it's working perfectly. After calling PUT: <https//M/admin/oauth2/auth/requests/login/accept|https//<my domain>/admin/oauth2/auth/requests/login/accept>, i'm getting the redirect_uri and once i redirect to that redirect_uri, i'm getting this error.
Here's what that redirect_uri looks like,
https://<my domain>oauth2/auth?client_id=<client_id>&login_verifier=<login_verifier>&redirect_uri=<callback_uri>&response_type=code&scope=<scopes>&state=<state>
l
@fast-lunch-54279 debugging advice?
@high-optician-2097?
h
is this in ory network and if yes what URL?
l
@few-orange-16990 maybe some XHR traces?
f
@high-optician-2097 do you mean url for starting the login flow ?
i just noticed that "ory_oauth2_login_csrf_xxx" cookie is not present when i initiate login flow from mobile browser, but it's present in case of desktop browser
.
h
Hi Umar, that is very strange. The cookie is a httpOnly and secure cookie. Is that maybe the issue?
f
@high-optician-2097 yes that is an issue, since it's httpOnly cookie, i can't do anything from my side, i'm using @ory/hydra-client sdk and here's my configuration: export const hydraAdmin = new AdminApi( new Configuration({ basePath: config.HYDRA_ADMIN_BASE, baseOptions: { withCredentials: true, headers: { Authorization: "Bearer " + config.ORY_TOKEN, }, }, }) ); export const hydraPublic = new PublicApi( new Configuration({ basePath: config.HYDRA_PUBLIC_BASE, baseOptions: { withCredentials: true, } }) ); i have been using this from months and it was working flawlessly without any issue.
Am i doing something wrong?
h
That is very strange. Is the android browser maybe limited in how large the cookies can get?
doesn’t look like it
f
cookie that i'm getting in a desktop browser is under 300 bytes.
h
hm…
i will allocate some time today. i need to install android and set up the env etc.
f
okay, thank you so much.
h
yeah the problem is that somehow the android browser opens http://myaccount.enschede.me and not https://myaccount.enschede.me
with https it works … we of course do not support insecure http
but I’m wondering how this is possible, ory network should automatically set https and not http
l
we use cloudflare and have this set
h
hm, not sure what the reason is, but the problem definitely is that anrdoid browser seems to allow http connection. if i use https in the browser, it works
f
login with kratos is working fine on android, the issue is with Oauth2 provider https://accounts.enschede.me
currently for debugging i have disabled the redirection so after login, you get the redirect_uri in console, and once you open that url in new tab, it should redirect to consent screen (which is working in desktop browser but not in android browser)
f
is that redirect_uri http or https?
f
https://<ory-domain>/oauth2/auth?client_id=<client-id>&login_verifier=<login-verifier>&redirect_uri=<redirect_uri>&response_type=code&scope=<scopes>&state=<state> this is what i'm getting as redirect_uri after i call acceptOAuth2LoginRequest() from sdk. and this should redirect me to consent screen. my callback url for redirection once consent request is accepted "<https//m|https//><my-domain>/oauth2/callback"
ok this is not working in safari desktop browser either.
h
https://accounts.enschede.me/ just gives me a balnk page?
f
@high-optician-2097 yes it requires login_challenge in query param to work, i'll create one sample client and send it to you so you can test it on https://openidconnect.net
Discovery Document URL : https://verify.enschede.me/.well-known/openid-configuration Authorization Token Endpoint: https://verify.enschede.me/oauth2/auth Token Endpoint: https://verify.enschede.me/oauth2/token Token Keys Endpoint: https://verify.enschede.me/.well-known/jwks.json OIDC Client ID: 7b75463e-30db-4a01-a5d0-6b052d5a112b OIDC Client Secret: e4bf3efc-1f43-4628-9a59-838b224868a0 Scope: openid profile email phone address offline here's the configuration, you test it on https://openidconnect.net @high-optician-2097
h
what redirect url did you register?
i don’t have a user to test it with though. do you have a test user?
f
hydrauser@gmail.com QwertyMnbv@123 try with this credentials @high-optician-2097
h
ok thanks, for me the flow worked flawlessly in safari
what other browsers did you try? android chrome?
f
i tried in chrome, firefox and safari
h
and it works in none of them?
i tried chrome and safari and it works in both
on macos
you?
f
@high-optician-2097 it worked for me in desktop browsers but not in mobile browsers
issue is resolved, looks like there was some issue with ionic app to browser redirection.
f
Thanks for confirming
h
awesome!!