cancel
Showing results for 
Search instead for 
Did you mean: 

CAP Java: Update JWT token to fetch new roles

10-13-2021 8:02 PM
christoffer_fuss Participant
38195 views 5 comments
SAP Managed Tags
Subscribe

Hello all,

we are developing a CAP Java application and are using the default XSUAA authentication with spring boot like described here. We have mapped a role collection via attribute mapping on SAP BTP. We have an API call which assigns this attribute to a user in our custom IDP.

We have the problem now, that the JWT is not changed after this API call and so not containing the new role.
Is there a way to update/renew the JWT or fetching a new JWT without forcing the user to relogin?

Best regards,

Chris

Accepted Solutions (0)

Answers (2)

Answers (2)

Technically I could imagine this would be possible with the Refresh Token Flow, implicitly used by approuter.

But I have never tested whether roles / scopes contained in the JWT get updated.

gregorw
SAP Mentor
SAP Mentor
0 Likes

Hi Alexander,

interresting thought. But do you think this would be also an option when using the managed approuter?

CU
Gregor

0 Likes

Hi Gregor, not sure, I would ask the question to approuter team 🙂

christoffer_fuss
Participant
0 Likes

Thanks for helping. I will try it out and let you know the result 🙂

Best regards,

Chris

gregorw
SAP Mentor
SAP Mentor
0 Likes

I think the only way to update the JWT is to ask the user to logout and login again.