Attributes for specific users#

Information about specific users is available at this endpoint. The information is fetched from Feide directories. In order to access the endpoint, a number of requirements have to be met.

API endpoint#

https://api.dataporten.no/userinfo/v1/lookup/{userid_sec}

Example#

The access token has the scopes system-all-users, userid-feide and userinfo-name. The endpoint is called for the testuser asbjorn_elevg@testusers.feide.no like so:

curl -sSLf -H 'Authorization: Bearer ....' \
'https://api.dataporten.no/userinfo/v1/lookup/feide%3Aasbjorn_elevg%40testusers.feide.no'

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"
    ]
}

Parameters#

userid_sec#

The userid_sec path parameter specifies the target user. This parameter contains the secondary user ID of the user, e.g. feide:user@kommune.test. Only Feide identifiers are supported.

The userid_sec must be percent encoded as specified in the rules for path segments in RFC 3986.

Example:

feide%3Auser%40kommune.test

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 requirements below aren’t met.

It returns 404 Not Found when the specified userid_sec can’t be found.

Requirements for accessing the endpoint#

  • The service must have the system-all-users scope.

  • The access token must have been obtained using the client credentials flow.

  • The service must have been activated for one of the organization units the user belongs to or the entire organization.