The userinfo API may be used to retrieve additional information about an end user beyond what is contained in the ID Token. The end user in question is given by the sub value contained in the access token. The implementation of userinfo is according to the OpenID Connect standard.

By including the supported scopes in the authorize request, the end user will be presented with consent dialogues for the requested end user information. If consent is given, you'll be able to access the TINFO resource servers by utilizing the Userinfo (TINFO Userinfo Endpoints) API to get the requested end user data by using the Access token as Bearer token.

Overview

URLhttps://<tinfo-userinfo-baseurl>/userinfo
Request

GET without any parameters

POST is not supported

CORS is not supported

AuthenticationAccess Token as Bearer Token in Authorization Header
Response
200OKJWT containing response elements
401UnathorizedBearer token is not accepted for any reason

Error responses contains further information on the reason according to standard.

ExampleSee below


Response elements

Userinfo returns signed responses in JWT format. The claims contained in the encoded JWT includes supported standard claims (see table below) along with the following additional claims:

ClaimExampleDescription
iss<tinfo-baseurl>TINFO Resource Server
audoidc-testclientRequesting OIDC client


Standard claims

ClaimScopeSupportConsentComment
subprofile(tick)
Subject Identifier. Also contained in ID Token
nameprofile(tick)
Common Name from associated BankID certificate. Also contained in ID Token 
given_nameprofile(tick)
First name part of the name claim. Also contained in ID Token 
familiy_nameprofile(tick)
Last name (surname) part of the name claim. Also contained in ID Token 
middle_nameprofile(error)

nicknameprofile(error)

preferred_usernameprofile(error)

profileprofile(error)

pictureprofile(error)

websiteprofile(error)

emailemail(tick)(thumbs up)Email is registered by end user himself for the TINFO service
email_verifiedemail(error)

genderprofile(error)

birthdateprofile(tick)
Birthdate from associated BankID certificate. Also contained in ID Token 
zoneinfoprofile(error)

localeprofile(error)

phone_numberphone(tick)(thumbs up)Phone number is registered by end user himself for the TINFO service
phone_number_verifiedphone(error)

addressaddress(tick)(thumbs up)

JSON structure with sub-elements as shown below

Address is registered by the end user himself for the TINFO service

address:formattedaddress(tick)
Full address string

address:street_address

address(tick)
Street address from
address:localityaddress(tick)
Norwegian "poststed"
address:regionaddress(error)

address:postal_codeaddress(tick)
Norwegian "postnummer"
address:countryaddress(error)

updated_atprofile(tick)
Epoc time for latest update of any of the supported TINFO data elements
nninnnin(tick)(thumbs up)Norwegian National Identiy Number (aka Norwegian SSN).

Example

Userinfo request
TBC


Decoded response
{
  "iss": "https://prototype.bankidnorge.no/tinfo-core-systemtest/",
  "sub": "9578-6000-4-30799",
  "aud": "oidc-testclient",
  "name": "Frode Beckmann NIlsen",
  "given_name": "Frode",
  "family_name": "NIlsen",
  "updated_at": 1519992419860,
  "email": "frobnil@online.no",
  "birthdate": "181266",
  "phone_number": "95871775",
  "address": {
    "formatted": "Lybekkveien 11C\nOslo 0772",
    "street_address": "Lybekkveien 11C",
    "locality": "0772",
    "postal_code": "Oslo"
  }
}


  • No labels