Skip to content

Commit d191f61

Browse files
authored
use preferred_username-claim2 (#348)
1 parent eb9370e commit d191f61

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

docker/prod/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ COPY ui/ .
66
RUN npm install
77
RUN npm run build
88

9-
FROM papermerge/auth-server:0.9.0build9 as auth_server
9+
FROM papermerge/auth-server:0.9.0build10 as auth_server
1010
FROM python:3.10 as papermerge_core
1111

1212
ENV CORE_APP=/core_app

papermerge/core/auth/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def extract_token_data(token: str = Depends(oauth2_scheme)) -> types.TokenData:
3535
)
3636
token_scopes = data.get("scopes", [])
3737
groups = data.get("groups", [])
38-
username = data.get("username", None)
38+
username = data.get("preferred_username", None)
3939
email = data.get("email", None)
4040

4141
return types.TokenData(

tests/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def auth_api_client(user: User):
4747

4848
middle_part = base64.encode({
4949
'sub': str(user.id),
50-
'username': user.username,
50+
'preferred_username': user.username,
5151
'email': user.email,
5252
'scopes': list(SCOPES.keys())
5353
})

tests/core/routes/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ def b64e(s):
1212
def token():
1313
data = {
1414
'sub': '100',
15-
'username': 'montaigne',
15+
'preferred_username': 'montaigne',
1616
'email': 'montaingne@mail.com'
1717
}
1818
json_str = json.dumps(data)

0 commit comments

Comments
 (0)