Configure the payload parsing after client-side authentication?


#1

Hello,

I could not find in the documentation an answer to this. Is it possible to configure the OAuth2Provider so that it reads the “code”, “client_id” and other required fields from the payload sent by the client-side authentication in a custom field?
I am trying to migrate from ng2-ui-auth 7.x.x to 8.x.x and it sends a payload like this instead of a flat one:

{
     "authorizationData": {
      //the same data sent to the auth endpoint
     },
    "oauthData": {
           //the data received from the oauth endpoint
       },
       "userData": {
           //additional data you've provided
       }
   }

(https://github.com/ronzeidman/ng2-ui-auth/blob/master/CHANGELOG.md)


#2

Hi,

this is possible with a custom request extractor: https://www.silhouette.rocks/docs/providers#section-request-extractors

The default extractor implementations can be found here: https://github.com/mohiva/play-silhouette/blob/master/silhouette/app/com/mohiva/play/silhouette/api/util/RequestExtractor.scala

Best regards,
Christian


#3

Great, I’ll look into that thanks!