Skip to content

feat: Added OIDC-compliant picture attribute mapping + JUnit 6 Tests + Bugfix#64

Open
kevin-paul00 wants to merge 4 commits into
wadahiro:masterfrom
kevin-paul00:master
Open

feat: Added OIDC-compliant picture attribute mapping + JUnit 6 Tests + Bugfix#64
kevin-paul00 wants to merge 4 commits into
wadahiro:masterfrom
kevin-paul00:master

Conversation

@kevin-paul00

Copy link
Copy Markdown

Pull Request - OIDC-compliant Picture Attribute Mapping

This PR implements the OIDC-compliant claim picture, introduces unit tests, and fixes a bug related to providing allowed guilds.

picture Claim

Discord provides a claim avatar that contains a hash of the user's profile picture. To access the link, it needs to be stitched together to a link of the formhttps://cdn.discordapp.com/avatars/<User ID>/<Hash>.<Datatype>?size=<Size>.
I have saved it in a new claim named picture, adhering to the OpenID Connect Standard. This enables services to access the profile picture in a standardized way without requiring Discord-specific logic.

Regarding the image size, Discord provides an image with the size 128 by default, which is a very low resolution. For now, I have hardcoded the size of 256. A future contributor could extend this project by implementing a configuration for a desired image size.

https://discord.com/developers/docs/reference#image-formatting

JUnit 6 Unit Tests + Mockito

To ensure the testability of the features, I have introduced unit tests using the latest JUnit 6 version. Mockito is used to mock certain objects that shall not be the subject of tests for now. (DiscordIdentityProviderTest.java makes use of it, for instance.)
I have written basic test cases for the project that may be extended in the future.

Bugfix: Allowed Guilds

It was possible to provide an invalidly formatted string (e.g., with trailing commas or spaces) that led to behavioral errors. I fixed it by sanitizing the input before saving the allowedGuilds string.

@kevin-paul00 kevin-paul00 marked this pull request as ready for review December 22, 2025 17:12
@kevin-paul00 kevin-paul00 changed the title feat: Added OIDC-compliant picture attribute mapping feat: Added OIDC-compliant picture attribute mapping + JUnit 6 Tests + Bugfix Dec 25, 2025
@ap-1 ap-1 mentioned this pull request Feb 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant