K
Kinde4mo ago
yeswolf

unable to login using kinde on Android apk preview

Hi All, I am using expo and building an app with Kinde as the login interface, but it doesn't let me login to the application after installing the apk on my android device. Is it something related to the Environment in Kinde ? Am i doing something wrong ? Thanks!
78 Replies
CB_Kinde
CB_Kinde4mo ago
Are you using a Kinde SDK?
yeswolf
yeswolfOP4mo ago
Yes I am!
CB_Kinde
CB_Kinde4mo ago
Can you tell me which one and the version please? Also, what browsere are you using on the device? And is the log in okay in your local env?
yeswolf
yeswolfOP4mo ago
It is working absolutely fine when running in local env When i click on the login in Android app it opens up in Google chrome Can you guide me on where I can find the version ? In the audit log it says this
yeswolf
yeswolfOP4mo ago
No description
yeswolf
yeswolfOP4mo ago
It keeps rotating but doesn’t go further
No description
CB_Kinde
CB_Kinde4mo ago
Were you expecting to login natively in the app or for the chrome window to open? We also recommend using the android SDK for Android apps as it supports an in-app sign in experience. See https://docs.kinde.com/developer-tools/sdks/native/android-sdk/
yeswolf
yeswolfOP4mo ago
No preference
CB_Kinde
CB_Kinde4mo ago
Hi. We can help more if you share the SDK and version. There have been some recent updates that may be impaciting the issue. Also, if cookies are blocked in the browser, this will block sign in.
yeswolf
yeswolfOP3mo ago
Absolutely! Is it possible to connect and have a chat related to the issue, if feel that could be much easier @kinde-oss/react-nativr-sdk-0-7x Hi Is there any chance that we can have a deeper look into the issue ? i am kind of stuck with no progress @everyone can someone help me out here ?
CB_Kinde
CB_Kinde3mo ago
Hi there. Sorry for the late response. Can you please share the device type and model and OS you are using please. I'll need to pull someone else in to help. @Yoshify would this be something you are familiar with?
yeswolf
yeswolfOP3mo ago
no worries! Samsung Galaxy S24 - Android - Version 14
Yoshify
Yoshify3mo ago
G'day @yeswolf Could you share your callback URLs from both the Kinde dashboard and your .env? One I'm most interested in is KINDE_POST_CALLBACK_URL
yeswolf
yeswolfOP3mo ago
Dashboard - exp://192.168.1.107:8081 not sure where i have that ? .env but this is what i see in my KindeSDK('....',exp://192.168.1.107:8081,'....','exp://192.168.1.107:8081')
Yoshify
Yoshify3mo ago
Ah, you're providing the configuration manually instead of using a .env - that's fine, disregard that part of my message. Are you using Expo Go for testing?
yeswolf
yeswolfOP3mo ago
yes
Yoshify
Yoshify3mo ago
And I'll also assume you're using EAS for deployment?
yeswolf
yeswolfOP3mo ago
yes yes it works fine when running on expo go on ios
Yoshify
Yoshify3mo ago
Sweet, just had to make sure before I gave you the wrong information 🙂 So it doesn't work in Expo Go for Android? Or it does, and it breaks after building with EAS?
yeswolf
yeswolfOP3mo ago
i haven't tested the Expo Go for android, i will test that in the next 5mins
Yoshify
Yoshify3mo ago
If you could that would provide some relevant debugging information 🙂 Referencing the documentation here, when you were building your application with EAS were you updating your Callback URL to the hosted expo URL?
Kinde docs
Expo and React Native SDK
Our developer tools provide everything you need to get started with Kinde.
Yoshify
Yoshify3mo ago
Note: A callback URL of exp://192.168.1.107:8081 is only valid during development, after publishing it should look more akin to exp://u.expo.dev/[project-id]?channel-name=channel-name]&runtime-version=[runtime-version] I'm fairly confident the breakdown is somewhere in the callback given that your authentication attempts succeed and generate an audit entry in Kinde, but the application isn't being updated.
yeswolf
yeswolfOP3mo ago
Expo Go - Android
No description
yeswolf
yeswolfOP3mo ago
But works on iOS Something ain’t right when using android "when you were building your application with EAS were you updating your Callback URL to the hosted expo URL" - I am not, keeping it the same
Yoshify
Yoshify3mo ago
That's interesting. Does the error log give you anything relevant?
yeswolf
yeswolfOP3mo ago
No description
Yoshify
Yoshify3mo ago
Is your Android device definitely on the same network as your computer? It's not attempting to use mobile data etc?
yeswolf
yeswolfOP3mo ago
same network turned off and testing now
Yoshify
Yoshify3mo ago
Alright - to start the project can you try npx expo start --tunnel?
yeswolf
yeswolfOP3mo ago
same
Yoshify
Yoshify3mo ago
Same error?
yeswolf
yeswolfOP3mo ago
yup but interestingly - this is what i see - exp://lhm4xdy-askpopuru-8081.exp.direct different from the exp://192.168........ not sure what's different from the initial run, looks like it has something to do with 'tunnel'
Yoshify
Yoshify3mo ago
Unfortunately I'd love to try take this further but I don't have an android device at hand for replication/testing. I just ran around my house looking to no avail 😅 Bear with me, I'm going to see if I can get another team member involved.
yeswolf
yeswolfOP3mo ago
wonderful! Thanks! Also, apologies for all the trouble
Yoshify
Yoshify3mo ago
Don't be sorry, we'll get to the bottom of it!
yeswolf
yeswolfOP3mo ago
Thanks! Knock Knock!
CB_Kinde
CB_Kinde3mo ago
Who's there? JK - sorry @yeswolf we are still trying to replicate the issue. We hae had some of our devs at a conference. Thanks for your patience.
ripvanwinkle
ripvanwinkle3mo ago
* Following* I think I am having the same issue
yeswolf
yeswolfOP3mo ago
@CB_Kinde can you please look into this issue
CB_Kinde
CB_Kinde3mo ago
Hi @yeswolf yep, it has been escalated to the team. Sorry about the frustration. It has been a hard one to look into and solve.
yeswolf
yeswolfOP3mo ago
Thanks and sorry for all the trouble!
CB_Kinde
CB_Kinde3mo ago
Just letting you know I haven't forgotten - I am prompting people every day
yeswolf
yeswolfOP3mo ago
Thanks for the push! Appreciate it!
Oli - Kinde
Oli - Kinde3mo ago
Hey @yeswolf, Sorry that you are still experiencing this issue. I can see you are using @kinde-oss/react-nativr-sdk-0-7x, what version of the SDK are you using? Also, did you follow React Native SDK doc or the Expo and React Native SDK doc? Also, are you able to confirm the following details are correct?: - Auth works on iOS, doesnt work on Android - Auth doesnt work on Expo Go (Android) app What callback URLs do you currently have configured?
Kinde docs
React Native SDK
Our developer tools provide everything you need to get started with Kinde.
yeswolf
yeswolfOP3mo ago
Kinde docs
Expo and React Native SDK
Our developer tools provide everything you need to get started with Kinde.
yeswolf
yeswolfOP3mo ago
Yup works on iOS(Expo Go) and doesn't work on Android(App and Expo Go)
yeswolf
yeswolfOP3mo ago
No description
yeswolf
yeswolfOP3mo ago
exp://192.168.1.107:8081 the sdk. - import { KindeSDK } from '@kinde-oss/react-native-sdk-0-7x';
Oli - Kinde
Oli - Kinde3mo ago
Hey @yeswolf, Thanks for sharing these details and screenshots. Are you able to let me know what version of kinde-oss/react-native-sdk-0-7x you are using? This will help us reproduce the issue
yeswolf
yeswolfOP3mo ago
"@kinde-oss/react-native-sdk-0-7x": "^1.3.1" - from package.json
Oli - Kinde
Oli - Kinde3mo ago
Hey @yeswolf, After investigating your issue further. It seems like it would be best for you to use our new @kinde/expo SDK. This SDK is not publically shared yet, since the SDK package is in a sort-of beta state. To solve your issue, we suggest using the new 0.2.0-0 version of the SDK - see here Let me know if you have any questions.
npm
@kinde/expo
The Kinde Expo SDK allows developers to quickly and securely integrate a new or an existing Expo application into the Kinde platform.. Latest version: 0.1.1, last published: 4 months ago. Start using @kinde/expo in your project by running npm i @kinde/expo. There are no other projects in the npm registry using @kinde/expo.
yeswolf
yeswolfOP3mo ago
Thanks for the info! The only question i have after goining through the doc is, there is no callback URL, so my assumption is everything is processed through the domain and client ID ?
yeswolf
yeswolfOP3mo ago
and that replaces this right ? Also i don't have my current SDK in App but in a different file but referrencing that, i dont think that should be a problem right ?
No description
Oli - Kinde
Oli - Kinde3mo ago
Hey @yeswolf, In the README of @Kinde/expo SDK - you can see the following:
The redirection URL is automatically computed using Expo Auth Session makeRedirectUri function. You can find more information about this function here.
Does this answer your question?
Expo Documentation
AuthSession
A universal library that provides an API to handle browser-based authentication.
yeswolf
yeswolfOP3mo ago
@Oli - Kinde this is a dependency issue can i get any input here
No description
Oli - Kinde
Oli - Kinde3mo ago
Hey @yeswolf, Sorry that you are experiencing this issue with the @Kinde/expo SDK v2.0.0-0 Unfortunately, my Expo expert team mate will be online from Jan 6 and will be addressing issues on the Expo SDK from then. Apologies for the inconvenience.
Oli - Kinde
Oli - Kinde3mo ago
@yeswolf - can you please raise a GitHub issue on the @Kinde/expo GitHub repo on the issue you experienced above? My expert teammate will be running throught the issues on the repo when he returns.
GitHub
GitHub - kinde-oss/expo: Library to integrate Kinde into an Expo pr...
Library to integrate Kinde into an Expo project. Contribute to kinde-oss/expo development by creating an account on GitHub.
3108sp
3108sp2mo ago
I'm also experiencing this same dependency issue, would be great to get this resolved. Have raised an issue on the @Kinde/expo GitHub repo
jamisonsheppard
jamisonsheppard2mo ago
I'm on expo 51 so I don't have the dependency issue but I also can't login with Android using kinde/[email protected]. I get 'no discovery document' in the token response.
CB_Kinde
CB_Kinde2mo ago
I will see where this work is at. Thanks for you patience.
3108sp
3108sp2mo ago
Hi @CB_Kinde just wondered if there was any update on this dependency issue? thanks a lot 🙂
CB_Kinde
CB_Kinde2mo ago
I'll nudge the team and get back to you 🙂
CB_Kinde
CB_Kinde2mo ago
I think the latest update that went a few days ago may have fixed it. https://github.com/kinde-oss/expo
GitHub
GitHub - kinde-oss/expo: Library to integrate Kinde into an Expo pr...
Library to integrate Kinde into an Expo project. Contribute to kinde-oss/expo development by creating an account on GitHub.
CB_Kinde
CB_Kinde2mo ago
GitHub
Release Release 0.2.0 · kinde-oss/expo
Note: Small breaking change, Kinde settings now need to be passed directly to the provider, see the readme. deps: loosen react-native peer depenancy (6158883) fix: prod environment variables (256c...
CB_Kinde
CB_Kinde2mo ago
Let me know if it does or doesn't fix and I'll chase up again.
jamisonsheppard
jamisonsheppard2mo ago
I just rebuilt our Android app with @kinde/expo": "^0.2.0" instead of 0.2.0-0, and still couldn't login, receiving the same error from the kinde.login({}) request: "no discovery document". iOS sim build correctly authenticates, though...native prod too
CB_Kinde
CB_Kinde2mo ago
Okay. Thanks for letting me know. @3108sp @yeswolf can you please see if the new Expo fixes your dependncy issue?
3108sp
3108sp2mo ago
thanks very much @CB_Kinde yes, that seems to fix my dependency issue 👍
CB_Kinde
CB_Kinde2mo ago
@jamisonsheppard sounds like you have a separate issue to the dependency issue raised here. Would you mind starting a new thread in the Support channel and we can investigate separately. TY
Tito
Tito5w ago
I was initially trying to use the react-native-sdk-0-7 as suggested at https://docs.kinde.com/developer-tools/sdks/native/expo-react-native/ but that fails because it tries to use the keychain (which is not supported on expo). I then switched to the kinde-oss/expo approach, which fails on android simulator with a No discovery document error
Kinde docs
Expo and React Native SDK
Our developer tools provide everything you need to get started with Kinde.
Tito
Tito4w ago
I am using @kinde-oss/[email protected] on a freshly started new expo app with latest sdk as of this week I have the same issue, I only tried Android Sim so far, fails with No discovery document. I would prefer to use @kinde-oss/react-native-sdk-0-7x but it doesn't work on expo, I believe because it should use expo-storage instead of react native keychain (not supported on expo) I wasn't able to build for ios, I think due to a mismatch in the version of @expo/config-plugins required by @kinde-oss/expo:
Expected package @expo/config-plugins@~9.0.0
Found invalid:
Expected package @expo/config-plugins@~9.0.0
Found invalid:
I now managed to build an ios simulator version, it fails with the following error:
Client authentication failed (e.g., unknown client, no client authentication included, or unsupported authentication method). The authorization server MAY return an HTTP 401 (Unauthorized) status code to indicate which HTTP authentication schemes are supported. If the client attempted to authenticate via the \"Authorization\" request header field, the authorization server MUST respond with an HTTP 401 (Unauthorized) status code and include the \"WWW-Authenticate\" response header field matching the authentication scheme used by the client.
More info: Client authentication failed (e.g., unknown client, no client authentication included, or unsupported authentication method).", "success": false}
Client authentication failed (e.g., unknown client, no client authentication included, or unsupported authentication method). The authorization server MAY return an HTTP 401 (Unauthorized) status code to indicate which HTTP authentication schemes are supported. If the client attempted to authenticate via the \"Authorization\" request header field, the authorization server MUST respond with an HTTP 401 (Unauthorized) status code and include the \"WWW-Authenticate\" response header field matching the authentication scheme used by the client.
More info: Client authentication failed (e.g., unknown client, no client authentication included, or unsupported authentication method).", "success": false}
It shows a quick success message `You are all signed in!" after signing in with email or social logins, but then it triggers the error above
Ages
Ages4w ago
Hello @Tito , Thank you for sharing the details. Here's a summary of the steps to resolve the issues: 'No discovery document' Error on Android: - Double-check Kinde settings (redirect URIs, client IDs). - Ensure proper network access for the Android simulator (try a physical device). - Simulators may have network restrictions; testing on a real device could help. More info: https://github.com/expo/expo/issues/9954. iOS Authentication Failure: - Verify client credentials in the Kinde dashboard. - Ensure the authentication method is supported (the @kinde-oss/react-native-sdk-0-7x might not work with Expo due to dependencies like react-native-keychain). More info: https://community.kinde.com/kindeoss-reactnativesdk07x-android-browser-compatibility-issue-g3mlYqMd1sNl. Dependency Issues with @kinde-oss/expo: - Ensure correct versions of @expo/config-plugins to avoid compatibility issues. Next Steps: - Review Kinde SDK docs for proper setup: https://docs.kinde.com/developer-tools/sdks/native/expo-react-native. - Check the GitHub repo for related issues or open a new one: https://github.com/kinde-oss/expo. Feel free to share any logs or further details for more specific help.
GitHub
Issues · expo/expo
An open-source framework for making universal native apps with React. Expo runs on Android, iOS, and the web. - Issues · expo/expo
Kinde
Kinde Community
Join the conversation
Tito
Tito4w ago
Thanks. Is there a working minimal example with actual details (i.e. what should I add to the list of redirect URIs on Kinde?)? It looks to me that errors in setup are caught when the app opens up the in-app browser. In my case, I can actually login in the in-app browser and receive a success message, but then the problem is when it is redirected back to the app. Maybe the app doesn't pick up the intents correctly (no information in the expo docs about setting up app.json with android intents and ios equivalent), maybe the component should have some state check before loading the <KindleAuthProvider> component, ... I also tried it on a physical android device, but i have the same error. When the in-app browser closes after successfully loggin in, the app is not in an authorized state, the redirect doesn't work properly
Ages
Ages4w ago
Hello @Tito , It seems that the issue may be with the redirect handling after the in-app browser closes. Since the app is not entering the authorized state after a successful login, it’s likely that the redirect URI is not properly configured or the app isn’t catching the redirect intents as expected. - Make sure that your redirect URIs are correctly set in the Kinde Dashboard. This should match the URI scheme you've defined in your app.json. - Since the redirect isn’t being picked up correctly, ensure that your app.json includes the necessary setup for both Android and iOS. You might need to explicitly define the intentFilters for Android and update the iOS scheme. For Android, your app.json might look like this:
{ "expo": { "platforms": ["android"], "android": { "package": "com.yourapp", "intentFilters": [ { "action": "VIEW", "data": { "scheme": "your-app-scheme" } } ] }, "ios": { "bundleIdentifier": "com.yourapp", "config": { "appAuth": { "redirectUri": "your-app-scheme://redirect" } } } } }
This ensures that Android properly catches the redirect. - It might be helpful to ensure that the component checks for a valid authenticated state before rendering. You can implement a check to see if the user is already logged in, or whether the app should wait for the redirect before attempting to authenticate again. - After making these adjustments, test on a physical device and check the app logs for any error messages related to the redirect handling. Ensure that the authorization flow works smoothly from login through the redirect back to the app. If you're still encountering issues, feel free to share the specific logs or error details and your current setup. I’d be happy to escalate this to our engineering team for a deeper investigation.
Tito
Tito4w ago
On the kinde dashboard I added my-app-scheme:// but i don't know what my redirect urls should be. Should i add my-app-scheme://redirect ? Anyway the login page would fail already without the urls added to the dashboard. My app.json for android already contained:
"android": {
"package": "com.streckenheld.app",
"intentFilters": [
{
"action": "VIEW",
"category": [
"DEFAULT",
"BROWSABLE"
],
"data": [
{
"scheme": "streckenheld",
"host": "streckenheld.kinde.com"
}
]
}
]
},
"android": {
"package": "com.streckenheld.app",
"intentFilters": [
{
"action": "VIEW",
"category": [
"DEFAULT",
"BROWSABLE"
],
"data": [
{
"scheme": "streckenheld",
"host": "streckenheld.kinde.com"
}
]
}
]
},
On the kinde dashboard I added these redirect urls:
streckenheld://
streckenheld://streckenheld.kinde.com/kinde_callback
streckenheld://redirect
streckenheld://streckenheld.kinde.com/redirect
streckenheld://
streckenheld://streckenheld.kinde.com/kinde_callback
streckenheld://redirect
streckenheld://streckenheld.kinde.com/redirect
I always get the same error No discovery document I couldn't find any example or discussions about Kinde on Expo anywhere, let me know if you can connect me with anyone actually using this
Ages
Ages4w ago
Hi Tito

I’ll pass this to my team and get back to you once I have more information. Please let me know if you encounter any new issues, and I’ll be happy to assist further
jamisonsheppard
Is there any updates from Kinde? I've followed all the above instructions where applicable and I'm still getting 'no discovery document' on Android. Is there a working example somewhere?
Daniel_Kinde
Daniel_Kinde2w ago
Hi @jamisonsheppard, We have been working and looking into this. Our starter kit we have which does not use our SDK is working (https://github.com/kinde-starter-kits/expo-starter-kit), our SDK is packaged up version of this yet in most cases the error you're experiencing happens. We are working directly with Expo team and experts to understand further the cause and hope to have a solution soon. In the mean time please refer to our starter kit. Migration to our SDK will be simple in the future.

Did you find this page helpful?