Skip to content

PIN-6662 Auth Server M2M token generation #1824

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 47 commits into
base: develop
Choose a base branch
from

Conversation

Viktor-K
Copy link
Collaborator

@Viktor-K Viktor-K commented Apr 23, 2025

Closes PIN-6662

Description

This PR enable Authorization server to provide a API Token with role M2M_ADMIN, this role allows users to API v2 usages.
The JWT Token with this role has claim "userId" with Client's AdminId.

Test

✅ Improve integration and unit tests with Token M2M_ADMIN role case

Screenshot 2025-04-23 at 15 13 27

ecamellini and others added 30 commits April 7, 2025 16:55
@Viktor-K Viktor-K changed the base branch from develop to PIN-6663_update-client-model April 23, 2025 08:33
@Viktor-K Viktor-K force-pushed the PIN-6662-auth-server-m2m-token-generation branch from 575aac1 to 299c3cc Compare April 23, 2025 09:01
@Viktor-K Viktor-K force-pushed the PIN-6662-auth-server-m2m-token-generation branch from 299c3cc to 8b43f20 Compare April 23, 2025 10:02
Copy link
Contributor

@AsterITA AsterITA left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, just a few points

@AsterITA AsterITA requested a review from rGregnanin April 28, 2025 08:04
Base automatically changed from PIN-6663_update-client-model to develop April 28, 2025 08:26
Copy link
Contributor

@rGregnanin rGregnanin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice job 🚀
I just suggest adminId as field name inside the token

@Viktor-K Viktor-K requested a review from AsterITA April 28, 2025 15:31
@Viktor-K Viktor-K marked this pull request as ready for review April 30, 2025 08:08
Copy link
Collaborator

@ecamellini ecamellini left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! You discussed about reusing the token models defined in AuthData, that now seem to be duplicated in the interop-token/models - is it tracked as a further task?

========================================== */
export type InteropJwtInternalPayload = InteropJwtCommonPayload & {
sub: string;
role: string;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
role: string;
role: Extract<SystemRole, "internal">

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants