Domanda

I am building an app where I use Scribe for all my oauth needs. I create a service API class overriding DefaultApi20 with my end points for authorization and token URLs.

However for Shopify, the authorization URL is dependent on another parameter (Eg: shop name) where the authorization url needs shopname as subdomain. How do I send parameters for this?

I can do the oauth manually constructing the auth url and token but I am looking for a better way to construct sending custom parameters.

Thanks.

È stato utile?

Soluzione

We had a similar situation where a variable on the API had to set differently for different users. We did the following:

-Created a custom serviceImpl which extended OAuth10aServiceImpl (may be OAuth20ServiceImpl in your case).

-gave it a method to set the variable on it's api class

-after service is created by your ServiceBuilder lookup the appropriate value and call the setter method of the service.

-continue with normal OAUth token flow

Note that you also need to let the API know to use the custom service class, for example:

@Override
OAuthService createService(OAuthConfig config)
{
    return new CustomServiceImpl(this,config) 
}

Hope that helps

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top