Package salesforce implements the OAuth2 protocol for authenticating users through salesforce. This package can be used as a reference implementation of an OAuth2 provider for Goth.
These vars define the Authentication and Token URLS for Salesforce. If using Salesforce Community, you should change these values before calling New.
salesforce.AuthURL = "https://salesforce.acme.com/services/oauth2/authorize salesforce.TokenURL = "https://salesforce.acme.com/services/oauth2/token
Provider is the implementation of `goth.Provider` for accessing Salesforce.
New creates a new Salesforce provider and sets up important connection details. You should always call `salesforce.New` to get a new provider. Never try to create one manually.
BeginAuth asks Salesforce for an authentication end-point.
Debug is a no-op for the salesforce package.
FetchUser will go to Salesforce and access basic information about the user.
Name is the name used to retrieve this provider later.
RefreshToken get new access token based on the refresh token
RefreshTokenAvailable refresh token is provided by auth provider or not
SetName is to update the name of the provider (needed in case of multiple providers of 1 type)
UnmarshalSession wil unmarshal a JSON string into a session.
Session stores data during the auth process with Salesforce. Expiry of access token is not provided by Salesforce, it is just controlled by timeout configured in auth2 settings by individual users Only way to check whether access token has expired or not is based on the response you receive if you try using access token and get some error Also, For salesforce refresh token to work follow these else remove scopes from here On salesforce.com, navigate to where you app is configured. (Setup > Create > Apps) Under Connected Apps, click on your application's name to view its settings, then click Edit. Under Selected OAuth Scopes, ensure that "Perform requests on your behalf at any time" is selected. You must include this even if you already chose "Full access". Save, then try your OAuth flow again. It make take a short while for the update to propagate.
Authorize the session with Salesforce and return the access token to be stored for future use.
GetAuthURL will return the URL set by calling the `BeginAuth` function on the Salesforce provider.
Marshal the session into a string