/// <summary> /// Initializes a new instance of the RefreshTokenInfo class. /// </summary> /// <param name="refreshToken">The refresh token value.</param> /// <param name="userId">The user ID associated with the token.</param> public RefreshTokenInfo(string refreshToken, string userId) { LiveUtility.ValidateNotNullOrWhiteSpaceString(refreshToken, "refreshToken"); LiveUtility.ValidateNotNullOrWhiteSpaceString(userId, "userId"); this.RefreshToken = refreshToken; this.UserId = userId; }
/// <summary> /// Initializes an instance of LiveAuthClient class. /// </summary> /// <param name="clientId">The client Id of the app.</param> /// <param name="refreshTokenHandler">An IRefreshTokenHandler instance to handle refresh token persistency and retrieval.</param> public LiveAuthClient( string clientId, IRefreshTokenHandler refreshTokenHandler) { LiveUtility.ValidateNotNullOrWhiteSpaceString(clientId, "clientId"); this.authClient = new LiveAuthClientCore(clientId, refreshTokenHandler, this); this.syncContext = SynchronizationContextWrapper.Current; }
public void LiveUtility_ValidateNotNullOrEmptyString_WhiteSpaceParameter() { LiveUtility.ValidateNotNullOrWhiteSpaceString(" \t ", "client_id"); }
public void LiveUtility_ValidateNotNullOrEmptyString_Normal() { LiveUtility.ValidateNotNullOrWhiteSpaceString("4303432830243", "client_id"); }
public void LiveUtility_ValidateNotNullParameter_Invalid() { LiveUtility.ValidateNotNullOrWhiteSpaceString(null, "client_id"); }
/// <summary> /// Exchange authentication code for access token. /// </summary> /// <param name="authenticationCode">The authentication code the app received from Microsoft authorization /// server during the user authorization process.</param> /// <returns></returns> public Task <LiveConnectSession> ExchangeAuthCodeAsync(string authenticationCode) { LiveUtility.ValidateNotNullOrWhiteSpaceString(authenticationCode, "authenticationCode"); return(this.authClient.ExchangeAuthCodeAsync(authenticationCode)); }
/// <summary> /// Initializes a new instance of the RefreshTokenInfo class. /// </summary> /// <param name="refreshToken">The refresh token value.</param> public RefreshTokenInfo(string refreshToken) { LiveUtility.ValidateNotNullOrWhiteSpaceString(refreshToken, "refreshToken"); this.RefreshToken = refreshToken; }