Comments (3)
In addition to the solution @davecoffin mentioned, Here is the function and imports that generate a verifier to create a challenge:
Install crypto-es with the following command:
npm i crypto-es
// crypto-es to use base64 and sha256 encryption.
import CryptoES from 'crypto-es';
const Base64 = CryptoES.enc.Base64;
const sha256 = CryptoES.SHA256;
getRandomValues(size) {
size = size >= 43 && size <= 128 ? size : 128;
let benchStr = '';
const possible = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
for (let i = 0; i < size; i++) {
benchStr += possible.charAt(Math.floor(Math.random() * possible.length));
}
return benchStr;
}
from nativescript-auth0.
Bump!
from nativescript-auth0.
I am also having this problem... my esteemed colleague @Vishwa52 has figured a workaround, but its unclear why this isnt working.
Here's his solution:
in safariWebAuth.js, replace the handler with this:
handler(redirectURL) {
if (this.responseType.indexOf(ResponseType.code) > -1) {
const authentication = new Auth0Authentication(this.clientId, this.url, this.telemetry);
authentication.logger = this.logger;
const verifier = this.getRandomValues(32)
const challenge = Base64.stringify(sha256(verifier)).replace(/\+/g, '-').replace(/\//g, '_').replace(/=/g, '');
return new PKCE(authentication, redirectURL, verifier, challenge, 'S256', this.responseType, this.nonce);
// return PKCE.init(authentication, redirectURL, this.responseType, this.nonce);
}
else {
return new ImplicitGrant(this.responseType, this.nonce);
}
}
It just skips the A0SHA256ChallengeGenerator
and generates one manually. @NathanWalker any ideas?
from nativescript-auth0.
Related Issues (20)
- Modify AndroidManifest.xml to address package visibility issue in Android 11
- GetUserInfo returns undefined but its properties are defined HOT 1
- Data loss when persisting a wrapped UserInfo HOT 1
- Android - Parameter 'prompt' set to 'none' - callback URL issue HOT 8
- Request: Custom App Delegate for Vue (iOS) HOT 1
- webAuthentication redirect for Android API 23 and lower - Vue HOT 3
- NS Vue Successful Login But Get Safari Cannot Open The Page HOT 2
- Tokens Used for API Call Getting Unauthorized HOT 1
- Odd iOS safari authenication interaction HOT 3
- Support for legacy authentication
- renewCredentials fails for IOS and Android - OIDC issue
- Request for maintainers HOT 1
- The Angular Sample don't work
- Struggling to set access type = 'offline'
- IOS - Base64URLSafe String replace error
- Changing scheme for redirect uri on Android HOT 1
- How to get name and profile image and stuff? HOT 5
- Needs update for NS 7 HOT 7
- Disable Popup every-time login
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nativescript-auth0.