Hi,
I need only some of information that the profile scope returns. I need only picture and nickname. So I opened the /.well-known/openid-configuration and see that scopes like picture and other are supported. So I tried requesting openid picture nickname, and I got only openid. So I saw that claims are supported. So I requested claims like it (value of claims parameter in request):
Unfortunately, the picture and nickname are not legitimate scopes that you can request.
When passing the profile scope in the request, you will get the claims that represent the basic profile information, which includes name, family_name, given_name, middle_name, nickname, picture, and updated_at claims.
Now, if you must require only a subset of these claims, like only having picture and nickname, you will have to write a Post-Login Action to append them as custom claims.
For example:
exports.onExecutePostLogin = async (event, api) => {
const namespace = 'https://myapp.example.com';
if (event.authorization) {
// Set claims in ID token
api.idToken.setCustomClaim(`${namespace}/nickname`, event.user.nickname);
api.idToken.setCustomClaim(`${namespace}/picture`, event.user.picture);
// Set claims in access token
api.accessToken.setCustomClaim(`${namespace}/nickname`, event.user.nickname);
api.accessToken.setCustomClaim(`${namespace}/picture`, event.user.picture);
};