bland-finland-95044
02/17/2025, 8:04 PMbland-finland-95044
02/17/2025, 8:07 PMory
.createBrowserSettingsFlow({
returnTo: returnTo,
})
Then I update the settings flow like this:
const body: UpdateSettingsFlowBody = {
method: "oidc",
link: "SSO_PROVIDER_FOR_ORG_HERE",
};
ory
.updateSettingsFlow({
flow: String(flow.id),
updateSettingsFlowBody: body,
})
.then(({ data }) => {
setFlow(data);
if (returnTo) {
router.push(returnTo || window.location.origin);
}
})
.catch((err: unknown) => {
if (err instanceof AxiosError && err.response?.status === 422) {
const errorData = err.response.data;
if (errorData.redirect_browser_to) {
router.push(errorData.redirect_browser_to as string);
}
} else {
setLoading(false);
}
});
That returns a 422 response that contains a redirect_browser_to
field with a URL from my SSO provider. If I redirect the browser to the URL, it successfully links the SSO account, but then the user gets sent to an error page with this message:
An error occurred with the following message: The settings flow is disabled for this organization
How else am I supposed to link an SSO provider without a settings flow? It seems like the settings flow half-way works, since it does link the SSO provider to the identity. I just need to redirect back to my application after the SSO provider is linked instead of going to that error page
I did try setting After OIDC Redirect URL
to our application URL, no luck therebland-eye-99092
02/18/2025, 3:05 PMbland-finland-95044
02/18/2025, 3:06 PMbland-finland-95044
02/18/2025, 5:15 PM