Page MenuHomeSoftware Heritage

keycloak: Open direct grant login endpoint
ClosedPublic

Authored by ardumont on Mar 4 2021, 5:56 PM.

Details

Summary

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'}

Diff Detail

Repository
rDAUTH Common authentication libraries
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

Build is green

Patch application report for D5197 (id=18613)

Rebasing onto 63b28edb1f...

Current branch diff-target is up to date.
Changes applied before test
commit dfc1252ded8411ad17b662ab6c8b178272aa16d4
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Thu Mar 4 17:54:57 2021 +0100

    keycloak: Open direct grant login endpoint
    
    This is needed for the incoming deposit-keycloak integration.
    
    Related to T3079

See https://jenkins.softwareheritage.org/job/DAUTH/job/tests-on-diff/14/ for more details.

anlambert added a subscriber: anlambert.

Looks good to me.

This revision is now accepted and ready to land.Mar 4 2021, 5:58 PM