Self-disclosure API in context of ID Broker

1. Self-disclosure API in context of ID Broker#

The Univention ID Broker eases the integration between identities of learners and teachers managed by school authorities or federal states and the various service providers for educational purposes with respect to the data protection regulations in Europe.

To use the API and request information about users like students and teachers, the service provider needs an authentication token. The user’s browser receives the authentication token from the Identity Provider (IDP) of their school authority and passes it to the service provider. With the authentication the service provider can then request additional information about the user from the Self-disclosure API.

1.1. Sequence diagram#

Fig. 1.1 shows the complete flow of a user that logs in to a service through a school’s portal website. The ID Broker provides user data through the Self-disclosure API. Step 8 in Fig. 1.1 uses the Self-disclosure API.

_images/overview_sequence.png

Fig. 1.1 ID Broker sequence: authentication and user data retrieval sequence#

The Self-disclosure API only returns service provider specific pseudonyms instead of real personal information. Two different service providers receive different pseudonyms for the same real user.

Note

At the time of writing some user data isn’t pseudonymized yet.

1.2. Authentication token#

In step 6 the Univention ID Broker responds with an authentication token for the user that wants to sign in. The response looks like the following example:

{'access_token': 'eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJUQTU1cEt1SGVQZWFqX2wxaC1DR2xHcVYwWnpva2pBX0FQYm1TSk5scURJIn0.eyJleHAiOjE3MTk5MDg2NzUsImlhdCI6MTcxOTkwODM3NSwiYXV0aF90aW1lIjoxNzE5OTA4Mzc1LCJqdGkiOiJjYzU2MTVkNC04YjM0LTRlNGMtYWE5YS1hZDc4Yjk0ZmVhMmQiLCJpc3MiOiJodHRwczovL3Nzby1icm9rZXIuc3RhZ2luZy51bml2ZW50aW9uLWlkLWJyb2tlci5jb20vYXV0aC9yZWFsbXMvSUQtQnJva2VyIiwiYXVkIjoic2VsZi1kaXNjbG9zdXJlLWFwaSIsInN1YiI6ImI0ZTkxN2Q5MjBlYWIyZTMxNDYxM2UyMTAwODVlZDE4ZTVjNjc5ZmE5NTYxNDE0ODhiYWEwMGRkYWM4NjIzYTQ1MTBkN2VhNjNjZTQ3NjMzM2I3NTgxY2UzY2M5M2RiMmM5OTc0MmM1MmQxY2Y1Zj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M2E0NTEwZDdlYTYzY2U0NzYzMzNiNzU4MWNlM2NjOTNkYjJjOTk3NDJjNTJkMWNmNWY5ZTBhNGI1N2I1YzgzYTgzYSIsInR5cCI6IlJlZnJlc2giLCJhenAiOiJ1bml2ZW50aW9uLXRlc3QtYXBwIiwibm9uY2UiOiJJR0lkUHJRT2h5NmFEOHlDaFJ0NCIsInNlc3Npb25fc3RhdGUiOiIxMjlhMTU4Ni02YWYzLTQ2MmYtYmY3Zi1mYzUzM2QwYjE5N2UiLCJzY29wZSI6Im9wZW5pZCBzZWxmLWRpc2Nsb3N1cmUtYXBpIiwic2lkIjoiMTI5YTE1ODYtNmFmMy00NjJmLWJmN2YtZmM1MzNkMGIxOTdlIn0.dt1xmDRxNOBrp9FjEzQu01CJhHlyl9IuYW66zdAnnpU',
 'scope': 'openid self-disclosure-api',
 'session_state': '129a1586-6af3-462f-bf7f-fc533d0b197e',
 'token_type': 'Bearer',
 'userinfo': {'acr': '1',
              'at_hash': 'WZ7J6-aDqsOd0jCbN6uxhg',
              'aud': 'univention-test-app',
              'auth_time': 1719908375,
              'azp': 'univention-test-app',
              'exp': 1719908675,
              'iat': 1719908375,
              'iss': 'https://sso-broker.staging.univention-id-broker.com/auth/realms/ID-Broker',
              'jti': '964c6aca-efdf-459f-97fd-835f0164fecd',
              'nonce': 'IGIdPrQOhy6aD8yChRt4',
              'session_state': '129a1586-6af3-462f-bf7f-fc533d0b197e',
              'sid': '129a1586-6af3-462f-bf7f-fc533d0b197e',
              'sub': 'b4e917d920eab2e314613e210085ed18e5c679fa956141488baa00ddac8623a4510d7ea63ce476333b7581ce3cc93db2c99742c52d1cf5f9e0a4b57b5c83a83a',
              'typ': 'ID'}}

The acces_token, refresh_token and the id_token are JSON web tokens (JWT) of the type bearer, also called JWT bearer tokens. The Self-disclosure API uses the token information to provide pseudonymized data to the service provider. Based on the data the service provider decides what content it presents to each user. When you get an acces_token you must request the openid self-disclosure-api scopes. No other scopes are allowed for self-disclosure-api clients.