I am in need of integrating React Native mobile app with OKTA for Authentication with following conditions:-
- No browswer based pop-up to be used. The app makes use of it's own native input elements for username and password.
- PKCE is to be used
- Make use of okta-auth-js library, or even IDX functionality within it.
Requesting if anyone can help.
The error being faced is on Storage ,as described below:-
const myMemoryStore:any = {};
const storageProvider = {
getItem: function(key : any) {
// custom get
return myMemoryStore[key];
},
setItem: function(key:any, val:any) {
// custom set
myMemoryStore[key] = val;
},
// optional
removeItem: function(key:any) {
delete myMemoryStore[key];
}
}
const authClient = new OktaAuth({
issuer: value,
clientId: value',
redirectUri: value,
scopes: ['openid','profile','email' ],
pkce: true,
storageManager : {
token : {
storageProvider : storageProvider,
}
})
async function handleLogin() {
authClient.signInWithCredentials({
username : value,
password : value
})
.then(function(transaction) {
console.log('transaction:', JSON.stringify(transaction));
})
.catch(function(err) {
console.error(err);
});
}