public LoginServicePickerViewModel() { this.googleClient = this.LoadSafelyFromLocalSettings(OAuth2ServiceConstants.GoogleOAuth2Service); this.facebookClient = this.LoadSafelyFromLocalSettings(OAuth2ServiceConstants.FacebookOAuth2Service); this.liveClient = this.LoadSafelyFromLocalSettings(OAuth2ServiceConstants.LiveOAuth2Service); this.GoogleLoginCommand = new RelayCommand(this.GoogleLogin); this.FacebookLoginCommand = new RelayCommand(this.FacebookLogin); this.LiveLoginCommand = new RelayCommand(this.LiveLogin); }
private OAuth2Client LoadSafelyFromLocalSettings(OAuth2ServiceConstants serviceConstant) { var localSettings = ApplicationData.Current.LocalSettings; var oauthClient = new OAuth2Client(); if (localSettings.Values.ContainsKey(serviceConstant.ClientId)) { oauthClient.Id = localSettings.Values[serviceConstant.ClientId].ToString(); } if (localSettings.Values.ContainsKey(serviceConstant.ClientSecret)) { oauthClient.Secret = localSettings.Values[serviceConstant.ClientSecret].ToString(); } return oauthClient; }
protected OAuth2ServiceBase(IOAuth2Initializer oAuth2Initializer, OAuth2Client oAuth2Client) { this.oAuth2Initializer = oAuth2Initializer; this.ClientId = oAuth2Client.Id; this.ClientSecret = oAuth2Client.Secret; }
public FacebookOAuth2Service(IOAuth2Initializer oAuth2Initializer, OAuth2Client oAuth2Client) : base(oAuth2Initializer, oAuth2Client) { }
public GoogleOAuth2Service(IOAuth2Initializer oAuth2Initializer, OAuth2Client oAuth2Client) : base(oAuth2Initializer, oAuth2Client) { }