pilcrowonpaper/arctic

Salesforce Additional URLs

Opened this issue · 6 comments

For the Salesforce provider, the token and authorize endpoints are hardcoded:

const authorizeEndpoint = "https://login.salesforce.com/services/oauth2/authorize";
const tokenEndpoint = "https://login.salesforce.com/services/oauth2/token";

There is a use case to pass in a dynamic base url, so a feature like providing a custom url, or toggle for the sandbox url is ideal. Ex:

var baseUrl = "https://login.salesforce.com";
if(isSandbox){
    baseUrl = "https://test.salesforce.com";
}
const authorizeEndpoint = baseUrl + "/services/oauth2/authorize";
const tokenEndpoint = baseUrl + "/services/oauth2/token";

Custom domains can also be passed, so it may be best to have an optional parameter in the OAuth2ProviderWithPKCE interface / contstuctor

We can add this in v2 - can you configure the path as well? i.e. are you limited to /services/oauth2/token or can you do something like /something-else/services/oauth2/token?

I don't believe you can configure the path. I can't see anywhere in the documentation that allows for this. There is the ability to run oauth through JWT.

Adding additional documentation for reference:

Thanks, will add this in v2!

Added in v2 beta

I can test this. Is there an easy way of updating & integrating w/ lucia to test?