gray-shoe-60285
09/20/2023, 1:31 PM<https://app.example.com>
. Currently, when the user lands on authenticated pages, we redirect an unauthorized user using oidc-client-ts
to our OAuth2 client login endpoint <https://auth.example.com/ui/login>
. When they log in with a username and password, they’re successfully redirected back to our app.
We want to use Ory elements to have a custom login page at <https://app.example.com/login>
. Here, we're creating a flow using ory.createBrowserLoginFlow(...).
The problem is when this flow is submitted with the correct email and password, it returns a 200
response and just sets the Ory Session Cookie but hasn't interacted with our OAuth2 client.
I think what we need is for it to return a 422
, similar to what's mentioned in the Ory docs. The redirect_browser_to
would hopefully be our OAuth2 <https://auth.example.com/oauth2/auth>...
endpoint - where the flow gets completed and the authorization code is obtained.
Once this works, we can always direct users to <https://app.example.com/login>
here instead of <https://auth.example.com/ui/login>
, so they only see our UI, not the default OAuth Ory Hydra one.
It feels like we're missing some setup in the Ory Network project config for this? Any help would be really appreciated! Thankslimited-photographer-61008
09/20/2023, 2:06 PMlimited-photographer-61008
09/20/2023, 2:07 PM422
after submitting email/passwordgray-shoe-60285
09/20/2023, 6:57 PMlimited-photographer-61008
09/20/2023, 7:34 PMgray-shoe-60285
09/21/2023, 6:28 AM/oauth2/auth
then that redirects to our custom login page with a login_challange
in the url. Should this be a flow instead? e,g, <https://app.examole.com/login?flow=>...
Despite these changes with this we are still not getting the 422 when submitting email + passwordsteep-lamp-91158
limited-photographer-61008
09/21/2023, 11:28 AMhydra_urls_login
to /ui/login
, then Ory should handle creating the login flow with the login_challenge and redirect to your custom login UI with the flow idlimited-photographer-61008
09/21/2023, 11:42 AMsteep-lamp-91158
steep-lamp-91158
limited-photographer-61008
09/21/2023, 11:50 AMlimited-photographer-61008
09/21/2023, 11:54 AMhttps://{slug}.<http://projects.oryapis.com/ui/login|projects.oryapis.com/ui/login>
redirects to https://{slug}.<http://projects.oryapis.com/self-service/login/browser?aal=&refresh=&return_to=|projects.oryapis.com/self-service/login/browser?aal=&refresh=&return_to=>
which then redirects to our custom uisteep-lamp-91158
gray-shoe-60285
09/21/2023, 11:58 AMsteep-lamp-91158
limited-photographer-61008
09/21/2023, 12:00 PMsteep-lamp-91158
limited-photographer-61008
09/21/2023, 12:03 PMsteep-lamp-91158
limited-photographer-61008
09/21/2023, 12:05 PMhydra_urls_login
tosteep-lamp-91158
limited-photographer-61008
09/21/2023, 12:06 PMhttps://{slug}.<http://projects.oryapis.com/|projects.oryapis.com/>
limited-photographer-61008
09/21/2023, 12:07 PMsteep-lamp-91158
limited-photographer-61008
09/21/2023, 12:09 PMlogin_challenge
search param in our custom UI codelimited-photographer-61008
09/21/2023, 12:11 PMorganization
param too. I guess we should handle that.steep-lamp-91158
limited-photographer-61008
09/21/2023, 12:14 PMsteep-lamp-91158
limited-photographer-61008
09/21/2023, 12:15 PMsteep-lamp-91158
limited-photographer-61008
09/21/2023, 12:16 PMsteep-lamp-91158
steep-lamp-91158
limited-photographer-61008
09/21/2023, 12:21 PMlimited-photographer-61008
09/21/2023, 12:22 PMsteep-lamp-91158
steep-lamp-91158
limited-photographer-61008
09/21/2023, 12:26 PMsteep-lamp-91158
steep-lamp-91158
limited-photographer-61008
09/21/2023, 1:25 PMsteep-lamp-91158
limited-photographer-61008
09/21/2023, 1:32 PMsteep-lamp-91158
steep-lamp-91158
limited-photographer-61008
09/21/2023, 1:52 PM