Get meta data of currently logged in user.
See original GitHub issueDescribe the problem
I’ve been looking at the documentation but I can’t find any information about it. Every user in the system has metadata, in that metadata are some data that I need, here’s the flow:
- User logs in (using web login,
auth0.webAuth.authorize
) - If login successful, get user metadata.
Here’s how I’m trying to do it, based on google search results directing me to some issues in this repo, and also the Github’s search bar, like this one https://github.com/auth0/react-native-auth0/issues/197
const credentials = await auth0.webAuth.authorize({
scope: 'openid profile email read:current_user',
connection
});
const { accessToken } = credentials;
const { sub } = await auth0.auth.userInfo({ token: accessToken });
const user = await auth0.users({ token: accessToken }).getUser({ id: sub });
I would get:
Bad Request: Bad HTTP authentication header format
at responseHandler (http://192.168.1.4:8081/index.bundle?platform=ios&dev=true&minify=false:263790:11)
at http://192.168.1.4:8081/index.bundle?platform=ios&dev=true&minify=false:263818:18
at http://192.168.1.4:8081/index.bundle?platform=ios&dev=true&minify=false:143005:24
at flush (http://192.168.1.4:8081/index.bundle?platform=ios&dev=true&minify=false:143688:11)
at tryCallOne (http://192.168.1.4:8081/index.bundle?platform=ios&dev=true&minify=false:3509:14)
at http://192.168.1.4:8081/index.bundle?platform=ios&dev=true&minify=false:3610:17
at http://192.168.1.4:8081/index.bundle?platform=ios&dev=true&minify=false:30747:21
at _callTimer (http://192.168.1.4:8081/index.bundle?platform=ios&dev=true&minify=false:30635:9)
at _callImmediatesPass (http://192.168.1.4:8081/index.bundle?platform=ios&dev=true&minify=false:30674:7)
at MessageQueue.callImmediates [as _immediatesCallback] (http://192.168.1.4:8081/index.bundle?platform=ios&dev=true&minify=false:30891:14)
What was the expected behavior?
Reproduction
Please read the description above.
Environment
- Version of this library used: 2.6.0
- Which framework are you using, if applicable:
- Other modules/plugins/libraries that might be involved:
- Any other relevant information you think would be useful:
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
get_user_meta() | Function - WordPress Developer Resources
get_metadata() wp-includes/meta.php. Retrieves the value of a metadata field for the specified object type and ID.
Read more >Add current product to the current logged in user meta data
Now to retrieve this custom user meta data and the WC_Product Object (from the product ID), you will use: $product_id = get_user_meta( get_ ......
Read more >Check for user meta data at Login - WordPress Stack Exchange
To accomplish this, I have added the following code to my functions.php file. However, with this in place, it won't let anyone log...
Read more >Understand How Metadata Works in User Profiles - Auth0
Auth0 provides a comprehensive system for storing metadata in the Auth0 user profile. You can use metadata to do the following activities:.
Read more >Get all user meta data by user ID in wordpress - Boopathi Rajan
If you want to get all user meta data by using id then use get_user_meta() function. For example user id is 25. Use...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
There are essentially 2 ways of accessing the user’s metadata:
https://YOUR_DOMAIN/api/v2/
) and include the following scoperead:current_user
.Exactly, please refer to this docs page.
Thank you very much for the help, we will try the
idToken
approach 🙇