private void AuthCallback(ILoginResult result) { if (FB.IsLoggedIn) { // AccessToken class will have session details var aToken = Facebook.Unity.AccessToken.CurrentAccessToken; // Print current access token's User ID Debug.Log(aToken.UserId); // Print current access token's granted permissions foreach (string perm in aToken.Permissions) { Debug.Log(perm); } facebookToken = aToken.TokenString; facebookUserID = aToken.UserId; facebookLogined = true; // AuzreAuthentication 을 사용하여 인증 토큰 가져 오기 azureAuth = new AzureAuthentication(); azureAuth.Login(AzureAuthentication.AuthenticationProvider.Facebook, ServerAddress, facebookToken, Login_success, Login_error); } else { Debug.Log("User cancelled login"); } }
public void FromCertificateStore() { var test = new AzureAuthentication() { CertificateName = "AzureDemo" }; Assert.IsNotNull(test.Certificate); }
public void FromPEM() { string content = File.ReadAllText(@"c:\temp\AzureDemo.pem"); var test = new AzureAuthentication() { PEMENcoded = content }; Assert.IsNotNull(test.Certificate); }
public async Task <ActionResult> Index(UserModel user) { string token = await AzureAuthentication.createToken(); bool result = AzureAuthentication.DoesUserExistsAsync("*****@*****.**", token); await AzureAuthentication.CreateUserAsync(user.userName, token); AzureAuthentication.UpdateUser(user.userName, user.password, token); AzureAuthentication.DeleteUser(user.userName, token); return(View()); }
private void btnUpload_Click(object sender, RoutedEventArgs e) { ///Exemple 1 AzureAuthentication azureAuthentication = new AzureAuthentication( "" , "" , "" ); AzureStorage storage = new AzureStorage(azureAuthentication); using (var fileStream = File.OpenRead(txtPath.Text)) { storage.Upload(fileStream, "filetest.txt"); } ///Exemple 2 AzureStorage storage1 = new AzureStorage("", "", ""); using (var fileStream = File.OpenRead(txtPath.Text)) { string fileName = storage1.Upload(fileStream); } }