Is there a list of special variables in the oauth pre and post mapping rules? For example, stsuu is pre-populated. I thought there were others that I had found before, perhaps the client and/or the token in an already set variable? I can't find a list, and I could have sworn I had seen documentation on this once.
At the moment, what I need is is a way to find the current token value, in its hashed format, in the post mapping rule. The reason why is I have logic that cleans up all previous tokens for the client when a new token is generated with a specific scope. I am currently using the new OAuthMappingExtUtils.deleteHashedToken function, which is working fine. However, when I call OAuthMappingExtUtils.getTokens(client_id, client_id) (where client_id is obviously set to the client the token is being generated for) it is returning all tokens INCLUDING the token that was just generated in the premapping rule (but has not yet been returned to the client). Hence, I am deleting the token that is being created and making it invalid.
I need a way to get this token value, hopefully in a hashed format, because getTokens() is returning all the tokens for the client in their hashed format. That way I can do a compare before I delete each one and not delete the most recent. Worse case, I figure I may be able to obtain the token value from the STSUU and rehash it, but this seems really dirty, and I am not sure how reliable it will be long term.
My only other thought was maybe to move this logic to the pre-mapping rule. But a long time ago, for whatever reason, I felt it best to take care of this in the post mapping rule, and I am now coming back to finish this task. Also, you might be wondering why I just simply don't use OAuthMappingExtUtils.deleteTokens in the pre-mapping rule. Well, I don't want all the tokens deleted, only ones with this specific scope set. So that is why I just don't simply delete them all. In the past, this is what I was doing, but there is a need not to remove tokens only unless they have this specific scope set.
Thanks for any input!
------------------------------
Matt Jenkins
------------------------------