protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); // Initialize our native providers SimpleAuth.Providers.Google.Init(this.Application); //SimpleAuth.Providers.Facebook.Init(this.Application, false); // Set our view from the "main" layout resource SetContentView(Resource.Layout.Main); FindViewById <Button>(Resource.Id.loginGoogleNative).Click += async(sender, e) => { // Create an OAuth credential and use its clientId var clientId = "419855213697-uq56vcune334omgqi51ou7jg08i3dnb1.apps.googleusercontent.com"; // Provide with or without the '.apps.googleusercontent.com' suffix var google = new SimpleAuth.Providers.GoogleApi("google", clientId) //, "UwQ8aUXKDpqPzH0gpJnSij3i") { { ServerClientId = "419855213697-uq56vcune334omgqi51ou7jg08i3dnb1.apps.googleusercontent.com", Scopes = new [] { "https://www.googleapis.com/auth/userinfo.profile" } }; var account = await AuthAsync(google); var user = await google.GetUserInfo(); // .. Do something with account }; FindViewById <Button>(Resource.Id.loginFacebookNative).Click += async(sender, e) => { // Use the App ID var clientId = "1475840585777919"; var fb = new SimpleAuth.Providers.FacebookApi("facebook", clientId, "native"); var account = await AuthAsync(fb); // .. Do something with account }; FindViewById <Button>(Resource.Id.loginGeneric).Click += async(sender, e) => { var oauth = new OAuthApi("someprovider", new OAuthAuthenticator( "authUrl", "tokenUrl", "redirecturl", "clientid", "clientsecret")); var account = await AuthAsync(oauth); // .. Do something with account }; }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); // Initialize our native providers SimpleAuth.Providers.Google.Init(this.Application); SimpleAuth.Providers.Facebook.Init(this.Application, false); // Set our view from the "main" layout resource SetContentView(Resource.Layout.Main); FindViewById <Button>(Resource.Id.loginGoogleNative).Click += async(sender, e) => { // Create an OAuth credential and use its clientId var clientId = "28116949007-uho7tcbsm17l8uq7t96fk8i9d6ftugnd"; // Provide with or without the '.apps.googleusercontent.com' suffix var google = new SimpleAuth.Providers.GoogleApi("google", clientId, "native") { Scopes = new [] { "https://www.googleapis.com/auth/userinfo.profile" } }; var account = await AuthAsync(google); // .. Do something with account }; FindViewById <Button>(Resource.Id.loginFacebookNative).Click += async(sender, e) => { // Use the App ID var clientId = "1475840585777919"; var fb = new SimpleAuth.Providers.FacebookApi("facebook", clientId, "native"); var account = await AuthAsync(fb); // .. Do something with account }; FindViewById <Button>(Resource.Id.loginGeneric).Click += async(sender, e) => { var oauth = new OAuthApi("someprovider", new OAuthAuthenticator( "authUrl", "tokenUrl", "redirecturl", "clientid", "clientsecret")); var account = await AuthAsync(oauth); // .. Do something with account }; }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); // Initialize our native providers SimpleAuth.Providers.Google.Init(this.Application); SimpleAuth.Providers.Facebook.Init(this.Application, false); // Set our view from the "main" layout resource SetContentView(Resource.Layout.Main); FindViewById<Button>(Resource.Id.loginGoogleNative).Click += async (sender, e) => { // Create an OAuth credential and use its clientId var clientId = "28116949007-uho7tcbsm17l8uq7t96fk8i9d6ftugnd"; // Provide with or without the '.apps.googleusercontent.com' suffix var google = new SimpleAuth.Providers.GoogleApi("google", clientId, "native") { Scopes = new [] { "https://www.googleapis.com/auth/userinfo.profile" } }; var account = await AuthAsync(google); // .. Do something with account }; FindViewById<Button>(Resource.Id.loginFacebookNative).Click += async (sender, e) => { // Use the App ID var clientId = "1475840585777919"; var fb = new SimpleAuth.Providers.FacebookApi("facebook", clientId, "native"); var account = await AuthAsync(fb); // .. Do something with account }; FindViewById<Button>(Resource.Id.loginGeneric).Click += async (sender, e) => { var oauth = new OAuthApi("someprovider", new OAuthAuthenticator( "authUrl", "tokenUrl", "redirecturl", "clientid", "clientsecret")); var account = await AuthAsync(oauth); // .. Do something with account }; }