User Info

What is user info, and how do I use it?

Learn how user info is used to store data about a user

User info is a blob of data that is made available to service providers. This blob can be changed via the dashboard, or via our API. Simply POST to us new JSON data to store, and we’ll update it in our systems.

Example User Info Query

Once a service provider has an access token, they can query an endpoint to get the user info of a given user.

$ curl https://auth.authproject-demo.com/oauth2/userinfo
{
    "fname": "Alan",
    "lname": "Turing",
    "sub": "user-75f3ef985d544ed0a6995523cf21660d"
}

NOTE: You must specify an OAuth access token in the Authorization header for this endpoint to work. See your OAuth client library for how to query the userinfo endpoint.

Example User Info Update

To update the stored user info, you can send a POST request to the same endpoint, with the entire blob you wish to store. We do not currently support inserts to existing user info, we only support replacement of what is there.

$ curl -X POST https://auth.authproject-demo.com/oauth2/userinfo
{
    "fname": "Alan",
    "lname": "Turing",
    "age": 41
}

NOTE: Do not send a sub value. This is a value populated by our systems, and cannot be changed.

A subsequent GET to the endpoint will return the updated values.

$ curl https://auth.authproject-demo.com/oauth2/userinfo
{
    "fname": "Alan",
    "lname": "Turing",
    "age": 41,
    "sub": "user-75f3ef985d544ed0a6995523cf21660d"
}