PT-AM-CPE practice question 4 of 35

Which of the following code examples inserts a may_act claim to the resulting token in a PingAM implementation?

Full set: 100 questions
Answer options
A: var mayAct = /* is a JSON object with may act property data */ token.addMayAct(mayAct)
B: var mayAct = /* is a JSON object with may act property data */ requestedToken.addMayAct(mayAct) Correct answer
C: var mayAct = /* is a JSON object with may act property data */ requestedToken.setMayAct(mayAct)
D: var mayAct = /* is a JSON object with may act property data */ token.setMayAct(mayAct)
Correct Answer:
B. var mayAct = /* is a JSON object with may act property data */ requestedToken.addMayAct(mayAct)
Explanation

In PingAM's OAuth 2.0 scripting, the requestedToken object represents the token that is being created and will be issued. The addMayAct(mayAct) method is the specific API call available on this object to insert the mayact claim, which is used for delegation in token exchange scenarios as defined by RFC 8693. The mayAct variable passed to the method must be a JSON object containing the claims for the party that is authorized to act on behalf of the subject.

Why Incorrect

A. var mayAct = ... token.addMayAct(mayAct): The token object typically represents the incoming or original token, not the new token being issued, making this the incorrect object to modify.
C. var mayAct = ... requestedToken.setMayAct(mayAct): The correct method name in the PingAM scripting API is addMayAct, not setMayAct.
D. var mayAct = ... token.setMayAct(mayAct): This uses both the incorrect object (token) and an incorrect method name (setMayAct).

References

PingAM Documentation, "Scripts Guide" -> "Scripting API" -> "RequestedToken (Scripting API)". The API documentation lists addMayAct(Object mayAct) as a method on the RequestedToken object, used to "Add the mayact claim to the token." This object is explicitly used in OAuth 2.0 access token modification scripts.

Scroll to Top