Attributes for the current user#

Information about the logged in user is available at this endpoint, which is also called “extended userinfo”. The information is fetched from Feide directories. It is only available for users logged in using a Feide account.

API endpoint#

https://api.dataporten.no/userinfo/v1/userinfo

Example#

The testuser asbjorn_elevg@testusers.feide.no is logged in and has the scopes userid-feide and userinfo-name in the access token. The endpoint is called like so:

curl -sSLf -H 'Authorization: Bearer ....' \
'https://api.dataporten.no/userinfo/v1/userinfo'

This gives the following output:

{
    "cn": [
        "Asbj\u00f8rn ElevG Hansen"
    ],
    "displayName": "Asbj\u00f8rn ElevG Hansen",
    "eduPersonPrincipalName": "asbjorn_elevg@testusers.feide.no",
    "givenName": [
        "Asbj\u00f8rn ElevG"
    ],
    "sn": [
        "Hansen"
    ],
    "uid": [
        "asbjorn_elevg"
    ]
}

Return values#

The endpoint returns a JSON object with data from Feide directories. The keys in the returned object are the attribute names. The available attributes page lists the attributes that may be included in the response and the attribute groups required to access them.

Errors#

The endpoint returns 403 Forbidden when the access token has expired or doesn’t grant access to any user information.

It returns 404 Not Found when the logged in user can’t be found.