Use Case: Securely decode and inspect a JWT (JSON Web Token) in PeopleSoft using native Java classes, without relying on external libraries or PeopleCode JSON parsers.
Why Decode a JWT in PeopleCode?
In modern PeopleSoft integrations — especially with OAuth 2.0, SSO (Single Sign-On), and Microsoft Azure AD authentication — JWTs (JSON Web Tokens) are used to pass identity and authorization information. For example:
-
A REST API request might carry a JWT in the
Authorization
header. -
You might need to extract user identity (
upn
,email
,roles
) from the token. -
You want to verify what claims (data) were issued in the JWT — without calling external tools.
🛠️ The Challenge
PeopleCode doesn't have built-in JWT libraries or even a native Base64 URL decoder. But with a little help from standard Java classes (available in all PeopleTools environments), we can manually decode and read the JWT payload.
✅ Use Case
Let’s say:
-
You have an OAuth-secured API call hitting PeopleSoft.
-
You’re intercepting the JWT from the
%Request.GetHeader("Authorization")
PeopleCode method. -
You want to read the user identity inside the token for auditing or mapping purposes.
🔧 Sample PeopleCode: Decode JWT Payload (Pure Java, No Parser Yet)