I’m trying to authenticate users using the react-native SDK, however, I always get this error message saying no credentials were found in the store whenever I try to get credentials after calling the authorize method.
[a0.credential_manager.invalid: No credentials were found in the store.]
Please what does it mean and what can I do to fix it?
Hey there!
It seems like the most effective way to handle that would be to raise a GitHub issue in the SDK repo so we can discuss it directly with the repo maintainers.
Once you have a link to it make sure to share it here so we can ping them. Thank you!
Hi there,
opened 07:10PM - 20 Mar 23 UTC
### Describe the problem
I have followed the instructions described in [HERE]… (https://auth0.com/docs/quickstart/native/react-native/00-login#integrate-auth0-in-your-application).
This is my `android/app/build.gradle`
```
....
defaultConfig {
applicationId "com.someapp.app"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
versionName "1.0"
manifestPlaceholders = [auth0Domain: "someapp.us.auth0.com", auth0Scheme: ${applicationId}"]
}
.....
```
This is how my `AppDelegate.mm` looks like
<img width="736" alt="Screen Shot 2023-03-20 at 19 06 23" src="https://user-images.githubusercontent.com/38583057/226441077-6e584539-5111-4eb8-b8da-6ba57321bc38.png">
When trying to log in a user, the in-app browser opens and the authentication process is completed on the first time but on fails when trying again. The browser window opens and clickly closes without allowing the user to enter their credentials and this error message `[a0.credential_manager.invalid: No credentials were found in the store.]` is returned.
### What was the expected behavior?
The user is able to login and I can then retrieve the `user` object and also the token using the `getCredentials()` method from the `useAuth0` hook.
### Reproduction
`App.tsx`
```Typescript
import { Auth0Provider } from 'react-native-auth0';
import { Config } from './config';
const App = () => {
return (
<Auth0Provider
domain={Config.AUTH0_DOMAIN}
clientId={Config.AUTH0_CLIENT_ID}
>
<RestOfApp/>
</Auth0Provider>
);
};
export default App;
```
`Login.tsx`
```Typescript
import { useAuth0 } from 'react-native-auth0';
const Login = () => {
const { authorize, user, getCredentials, error } =
useAuth0();
const onLogin = async () => {
try {
await authorize();
const creds = await getCredentials();
console.log(error, creds);
} catch (error) {
console.log(error);
}
};
return (
<View>
<Button
onPress={() => {
onLogin();
}}
title="Login"
/>
</View>
);
};
export default Login;
```
`android/app/build.gradle`
```
....
defaultConfig {
applicationId "com.someapp.app"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
versionName "1.0"
manifestPlaceholders = [auth0Domain: "someapp.us.auth0.com", auth0Scheme: ${applicationId}"]
}
.....
```
`ios/AppName/AppDelegate.mm`
<img width="736" alt="Screen Shot 2023-03-20 at 19 06 23" src="https://user-images.githubusercontent.com/38583057/226441077-6e584539-5111-4eb8-b8da-6ba57321bc38.png">
Just build and run the app and try to log in.
### Environment
- **Version of this library used: 2.17.1
- **Which framework are you using, if applicable: React Native (0.71.3)
Here is the link to the issue I created.
1 Like
Perfect! I’ll ping the repo maintainers in a few minutes!
system
Closed
April 5, 2023, 11:26am
5
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.