Skip to content

keycloak: Open direct grant login endpoint

This is needed for the incoming deposit-keycloak integration.

Related to T3079

Test Plan

tox

docker/ipython:

In [172]: kctoken = kc.token(username="johndoe", password="johndoe-swh", grant_type="password", scope="openid")

In [173]: kc.decode_token(kctoken['access_token'], key=key)
Out[173]:
{'exp': 1614877121,
 'iat': 1614876821,
 'jti': 'd8710612-20d3-498a-945d-7bc7f0213247',
 'iss': 'http://localhost:5080/keycloak/auth/realms/SoftwareHeritage',
 'aud': ['swh-web', 'account'],
 'sub': '2c179658-ff62-40fa-beb5-0a57ca368efb',
 'typ': 'Bearer',
 'azp': 'swh-web',
 'session_state': 'c4609a6e-d8e8-4ed4-bf58-ba6d9580b71c',
 'acr': '1',
 'allowed-origins': ['http://localhost:5004'],
 'realm_access': {'roles': ['offline_access', 'uma_authorization']},
 'resource_access': {'account': {'roles': ['manage-account',
    'manage-account-links',
    'view-profile']}},
 'scope': 'openid email profile',
 'email_verified': False,
 'name': 'John Doe',
 'groups': [],
 'preferred_username': 'johndoe',
 'given_name': 'John',
 'family_name': 'Doe',
 'email': 'john.doe@example.org'}

Migrated from D5197 (view on Phabricator)

Merge request reports