Issue With Loading The Custom Token Attributes Plugin. Unable to pass the additional custom attributes in the Access token

(Doc ID 2302706.1)

Last updated on NOVEMBER 06, 2017

Applies to:

Oracle Mobile and Social - Version 11.1.2.3.0 and later
Information in this document applies to any platform.

Symptoms

You are following Oracle doc
https://docs.oracle.com/cd/E40329_01/dev.1112/e27134/oauthdev.htm#AIDEV6868

This document shows you how to setup OAuth to pass custom attributes and assigned values created in a custom jar file. However, after completing the steps in this document, the attributes and values are not present after running the access token trough the debuggers test web site.

The default attributes and their values appear in the output, but the custom attribute and their values do not appear.


Here is how the problem is reproduced:

I used the following two docs that the customer was following.

1.
https://docs.oracle.com/cd/E40329_01/dev.1112/e27134/oauthdev.htm#AIDEV6868


2. https://blogs.oracle.com/MauriceLuizink/tags/jwt

You are trying to pass custom attributes and the values assigned to those attributes through the custom java code. The issue occurs after processing the token generated from the CURL command, the custom attributes employee_id and spAppGroup are not delivered in the final payload. The following are the steps taken to reproduce this issue:

From the command prompt on the instance running OAuth, I ran the following CURL command:

curl -i -H "Authorization: Basic
NTBiZjk2M2M5ZmJkNDEzYmJlOTFiOTFhNmExNWNhMWY6MnVCd0pZYUw=" -H "Content-Type:
application/x-www-form-urlencoded;charset=UTF-8" -X POST
http://identity.example.com:14100/ms_oauth/oauth2/endpoints/oauthservice/tokens -d "grant_type=client_credentials"

This command produced the following token.

{"oracle_client_assertion_type":"urn:ietf:params:oauth:client-assertion-type:j
wt-bearer","expires_in":604800,"token_type":"Bearer","oracle_tk_context":"clie
nt_assertion","access_token":"eyJhbGciOiJSUzUxMiIsInR5cCI6IkpXVCIsIng1dCI6InV6
dGtDZktPNFVBY0MzUlEyaU5OcEoyTUhWZyIsImtpZCI6Im9yYWtleSJ9.eyJvcmFjbGUub2F1dGgud
GtfY29udGV4dCI6ImNsaWVudF9hc3NlcnRpb24iLCJleHAiOjE0OTI3MDUzMDYsInN1YiI6IjUwYmY
5NjNjOWZiZDQxM2JiZTkxYjkxYTZhMTVjYTFmIiwiaXNzIjoid3d3Lm9yYWNsZS5leGFtcGxlLmNvb
SIsInBybiI6IjUwYmY5NjNjOWZiZDQxM2JiZTkxYjkxYTZhMTVjYTFmIiwianRpIjoiOTFjMjRjN2U
tZTAwZi00MzhlLTk2MjgtNjY3ZmRhNzVkZjY0Iiwib3JhY2xlLm9hdXRoLnN2Y19wX24iOiJPQXV0a
FNlcnZpY2VQcm9maWxlIiwiaWF0IjoxNDkyMTAwNTA2LCJvcmFjbGUub2F1dGguaWRfZF9pZCI6IjE
yMzQ1Njc4LTEyMzQtMTIzNC0xMjM0LTEyMzQ1Njc4OTAxMiIsInVzZXIudGVuYW50Lm5hbWUiOiJEZ
WZhdWx0RG9tYWluIiwib3JhY2xlLm9hdXRoLnBybi5pZF90eXBlIjoiQ2xpZW50SUQifQ.CruizS0p
dq2MuCDLPChRN5rm6wzKFw4QJCuDB6_6G1ZcXONd7FmkLXdadvD3CEKGPaScpiOiUU52sTYkf1PK9b
V__IkYOCoBdx_5_kyk3EogRR0sTUNJefhC_zpIRzrAzHAzgV6fCHaPyRpoye6JwuTl3ue4ZBIEh2lG
LJny0xc"}

The access token was then placed in the "Encoded" side of this web site
Debugger tool:

https://jwt.io/

When the access token is processed, we should see the two custom attributes "employee_id" and "spAppGroup", along with their assigned values in the decoded side of the Debugger test web site but the attributes and their values are not present.

 

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms