ChainStoreWeb.TokenHelper.GetAccessToken C# (CSharp) Method

GetAccessToken() public static method

Retrieves an access token from ACS to call the source of the specified context token at the specified targetHost. The targetHost must be registered for the principal that sent the context token.
public static GetAccessToken ( SharePointContextToken contextToken, string targetHost ) : OAuth2AccessTokenResponse
contextToken SharePointContextToken Context token issued by the intended access token audience
targetHost string Url authority of the target principal
return OAuth2AccessTokenResponse
        public static OAuth2AccessTokenResponse GetAccessToken(SharePointContextToken contextToken, string targetHost)
        {
            string targetPrincipalName = contextToken.TargetPrincipalName;

            // Extract the refreshToken from the context token
            string refreshToken = contextToken.RefreshToken;

            if (String.IsNullOrEmpty(refreshToken))
            {
                return null;
            }

            string targetRealm = Realm ?? contextToken.Realm;

            return GetAccessToken(refreshToken,
                                  targetPrincipalName,
                                  targetHost,
                                  targetRealm);
        }

Same methods

TokenHelper::GetAccessToken ( string refreshToken, string targetPrincipalName, string targetHost, string targetRealm ) : OAuth2AccessTokenResponse
TokenHelper::GetAccessToken ( string authorizationCode, string targetPrincipalName, string targetHost, string targetRealm, Uri redirectUri ) : OAuth2AccessTokenResponse