chilly-memory-85439
05/10/2023, 6:51 PMchilly-memory-85439
05/11/2023, 6:33 AMbland-eye-99092
05/11/2023, 7:28 AMshy-fish-88756
05/15/2023, 7:06 AMreturnToCode, you need to use App Links. That requires a public file on <domain>/.well-known/assetslinks.json https://developer.android.com/training/app-links
We had to wrap kratos on an nginx in order to serve this file (I'm not a web dev)
@bland-eye-99092 I think this assetlinks.json should be supported natively by kratos. Otherwise it's hard to capture a url on android, specially for localhost testingshy-fish-88756
05/15/2023, 7:11 AMable-action-45419
05/15/2023, 7:40 AM<https://discord.com/oauth2/authorize?client_id=1045010489089994853&prompt=none&redirect_uri=https%3A%2F%><my-domaine>.live%2Fself-service%2Fmethods%2Foidc%2Fcallback%2Fdiscord&response_type=code&scope=identify+email&state=YWU4MWUwMjYtYWJmNy00YjJiLWFmMjYtNTJlNzA0NTIwMDQ1Ov-YwOJzIk8xkWFi2Eshnfg
But Kratos show an error that /<my-domain>/self-service/methods/oidc/callback/*discord* didn’t exist. How did you make it works for the redirect_uri please ?bland-eye-99092
05/15/2023, 7:44 AMdiscord part of the URL refers to the id of the provider in your configuration. Did you perhaps name it something different there?able-action-45419
05/15/2023, 7:47 AMredirect_uri parameters, it’s exactly the same that i’ve configure here : https://ory-community.slack.com/archives/C012RJ2MQ1H/p1684133858965099shy-fish-88756
05/15/2023, 9:58 AMchilly-memory-85439
05/16/2023, 12:13 AMchilly-memory-85439
05/16/2023, 2:01 AMIn Android, to capture the link with the returnToCode, you need to use App Links. That requires a public file on <domain>/.well-known/assetslinks.json <https://developer.android.com/training/app-links>
• If using custom schema, you need the https:// service endpoint for the ory console and then redirect to your custom schema.
After all of that is done, you mention that you are not receiving the 422. This code is received on the catch block of the Frontend.updateLoginFlow( params ), as showed on the onSubmit function here. The handleFormSubmitError function receives the errorResponse and handles it depending on the err.response.statusCode as showed here. There it is your choice of how you handle the url in err.response.data.redirect_browser_to, but I recomend using the example they use there, just note that the return URL used on the WebBrowser.openAuthSessionAsync (second param) must match exactly the return URL on the createNativeLoginFlow.
Hope this helps. You can keep asking as you go through some of these points.able-action-45419
05/16/2023, 7:52 AMchilly-memory-85439
05/16/2023, 5:13 PMconst redirect = async function (context: Context, req: HttpRequest): Promise<void> {
var scheme = `<com.mycompany.app://auth>`;
const returnURL = new URL(scheme);
Object.entries(req.query).forEach(([key, value]) => {
returnURL.searchParams.append(key, value);
});
context.res = { status: 302, headers: { location: returnURL.href }, body: null };
};bland-eye-99092
05/16/2023, 6:25 PMable-action-45419
05/17/2023, 4:05 AMchilly-memory-85439
05/17/2023, 1:40 PMchilly-memory-85439
05/17/2023, 1:41 PMbland-eye-99092
05/17/2023, 1:43 PMchilly-memory-85439
05/17/2023, 1:53 PMshy-fish-88756
06/05/2023, 2:52 PMOn Android using CustomTabs, the redirect opens a new ActivityYou can process the captured redirect_uri inside
onNewIntent on the same activity, just in case you didn't know that. It's what we are doing.elegant-traffic-69008
06/21/2023, 9:14 AMchilly-memory-85439
06/24/2023, 6:05 PMelegant-traffic-69008
06/26/2023, 6:52 AM