Comments (7)
Had to pass scope
param to passport.authenticate
:
passport.authenticate('auth0', { scope: 'openid', failureRedirect: '/' }),
from passport-auth0.
@asharifi the id_token
is only present when the responseType
is set to code
when sending the initial request to the api.
from passport-auth0.
var strategy = new Auth0Strategy({
domain: process.env.AUTH0_DOMAIN,
clientID: process.env.AUTH0_CLIENT_ID,
clientSecret: process.env.AUTH0_CLIENT_SECRET,
callbackURL: "/auth0callback"
},
function (accessToken, refreshToken, extraParams, profile, done) {
console.log(extraParams.id_token);
return done(null, profile);
});
Output: undefiend
from passport-auth0.
@mikemimik thanks for reply. So what should I change/add to my library to be able to get that in the function??
from passport-auth0.
@asharifi in your application, I'm making the assumption that you have the user login on some route /login
where they are presented with a login form/modal. Assuming again, on this page, you are using the lock
library. Then in the options
variable given to the constructor of Auth0Lock
you would need to have something like the example below.
var lock = new Auth0Lock('{{clientID}}', '{{domain}}', {
auth: {
responseType: 'code',
redirectUrl: '{{callbackUrl}}'
}
});
lock.show();
Where {{clientID}} is the clientID of the application you're using with auth0 (eg:
EDSHwerwk2l1kjf
), {{domain}} is the tenant domain you're using with auth0 (eg:mycompany.auth0.com
), and {{callbackUrl}} is a white listed callback url you have added to the client you're using on auth0 (eg:http://localhost:3000/callback
)In the above example I've also assumed that you're using a templating language that usings handlebars (
{{
,}}
) to wrap view model variables.
from passport-auth0.
Having the same issue, docs are not accurate
from passport-auth0.
Looks like the docs are indeed incomplete?
from passport-auth0.
Related Issues (20)
- Cannot read property 'split' of undefined in Profile.js with GSuite login HOT 5
- TypeError: Cannot read property 'authParams' of undefined HOT 4
- 1.2.1 -> 1.3.1 upgrade causes "Cannot read property 'scope' of undefined" HOT 1
- Consider releasing 1.3.2 ASAP HOT 2
- Allow arbitrary URL parameters for login redirect HOT 3
- Having a session is now required HOT 3
- new Auth0Strategy() returns profile, profile does not return app_metadata HOT 7
- Documentation link is no longer using this library HOT 2
- Login loop when using multiple frontend instances on the same url HOT 2
- Strategy does not support OAuth 2.0 Form Post Response Mode HOT 1
- Usage with Auth0.js checkSession or similar HOT 2
- Options values being overwritten by defaults
- Discord connection scope override not working HOT 6
- Request is deprecated HOT 6
- Passing my own state doesn't work with openid scope? HOT 6
- Unable to verify authorization request state HOT 3
- easy access to user profile and populating on frontend
- Error: Nonce (nonce) claim must be a string present in the ID token HOT 9
- Please upgrade axios to >1.6.0 HOT 7
- crypto.randomBytes throws TypeError in Node v20 HOT 4
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 passport-auth0.