Tag: authentication

了解Google身份validation器应用程序的工作原理

我见过很多双因素authentication应用程序,如谷歌身份validation应用程序。 该应用程序离线工作,每30秒重置手机上的密钥。 那么服务器如何知道哪些密钥是有效的? 我无法理解这一点? 如果我自己创build这样一个应用程序。 我怎么能这样做?

FB.Logout()在UnitySDK中不工作

我已经成功地使用FB.LoginfunctionloginFB。 现在我想注销: FB.Logout(); Debug.Log("FB IS LOGGED IN " + FB.IsLoggedIn); 我期待上面的代码打印FB.IsLoggedIn的值为false,并要求我在下一个FB.Login的login名和密码。 实际上, FB.IsLoggedIn的值是真的,我没有被注销: FB.Login下一个调用不要求密码,当我在浏览器中打开Facebook网站时,我没有被注销。 我也尝试使用未logging的请求来https://www.facebook.com/logout.php?next=[YourAppURL]&access_token=[ValidAccessToken]但它对我没有任何影响。 如何在独立的统一应用程序中将用户从Facebook中注销? 实际上我需要的是用不同的login名和密码login。 也许我可以使访问令牌无效,这将导致FB再次要求我的login名和密码? 任何帮助深表感谢。 SDK版本:5.0.1 生成版本:140401.725cc2ecbc9002a Unity版本4.3.3f1(c8ca9b6b9936)

如何让Rails告诉用户login的移动应用程序?

我正在开发一个使用devise作为身份validation解决scheme的Rails应用程序。 对于Web应用程序,用户在表单中input用户名和密码,Rails可以在用户login后呈现不同的页面。 现在我想用这个框架来支持移动应用程序。 在这种情况下,移动应用程序需要知道用户是否input正确的用户名和密码。 如何devise响应的移动应用程序,响应标题或JSON体内? devise支持吗?

validation程序和制定新的用户逻辑,parse.com

我被困在如何思考何时创build新的匿名用户。 这就是我的应用程序现在安装的方式。 我有三个ViewController。 1) GetPhoneController ,2) VerificationController ,3) ViewController GetPhoneController:是第一个视图,如果打开应用程序的用户没有用户存储的含义[PFUser currentUser]; 等于NULL,那么这个视图将被运行,否则ViewController将执行(检查在AppDelegate中完成)。 这个视图将只是获得用户的电话号码在UITextField中,并发送到下一个控制器 VerificationController:打开此视图时,将通过validation码向用户发送文本消息。 我正在使用Twilioparsing。 validation码保存在用户对象的自定义字段中,稍后用于匹配代码。(这里的问题你会知道为什么会在后面)。 如果用户input正确的validation码,则检查完成,如果用户确实这样做,那么我想要创build匿名用户并转到下一个控制器。 为什么? 因为如果我在validation之前创build了一个用户,那么在一个场景中,用户可能会closures该应用程序,然后创build一个用户以占用额外的空间。 所以我的问题是,我尝试将validation码保存到不存在的用户,因为我想validation后创build它。 如果您有更好的解决scheme来更好地validation逻辑步骤,那么解决scheme将会非常棒,甚至更好。 另外,我从来没有注销用户,因为我不想让用户在validation完成后login,这也就意味着匿名用户会被删除,是不是很糟糕,或者可以这样使用吗? 谢谢!

从unauth切换到开发人员身份validation的authentication用户 – AWS iOS SDK

总体问题:我的前端(iOS)使用开发人员身份validation身份存在问题。 我知道我的后端产生正确的标记和身份ID,但我的刷新方法永远不会被调用。 我也看了一下这个例子,但是对于一切事情我都有些困惑。 stream说明:目前我有一个login屏幕,有一个loginbutton。 用户按下loginbutton,然后我的api类获取凭证,encryption密码并将其存储在钥匙串中(现在注释掉,因为它在模拟器上不起作用)。 我的DeveloperAuthenticatedIdentityProvider被称为我的应用程序BusytimeAuthenticated。 我已经完成了所有的方法(我正在使用AWS lambda和DynamoDB对用户进行身份validation),我以未经身份validation的访问开始,允许我仅访问两种方法,即login和注册。 然后我想假设我的身份validation的用户允许我打电话给我的其他方法。 我的API代码: [AWSLogger defaultLogger].logLevel = AWSLogLevelVerbose; id<AWSCognitoIdentityProvider> identityProvider = [[BusytimeAuthenticated alloc] initWithRegionType:AWSRegionUSEast1 identityId:nil identityPoolId:@"SOMEIDENTITYPOOLID" logins:@{@"SOMEPROVIDERNAME": @"SOMEUSERNAME"} providerName:@"SOMEPROVIDERNAME" ]; credentialsProvider = [[AWSCognitoCredentialsProvider alloc] initWithRegionType:AWSRegionUSEast1 identityProvider:identityProvider unauthRoleArn:nil authRoleArn:nil]; configuration = [[AWSServiceConfiguration alloc] initWithRegion:AWSRegionUSEast1 credentialsProvider:self.credentialsProvider]; AWSServiceManager.defaultServiceManager.defaultServiceConfiguration = configuration; [[credentialsProvider refresh] continueWithBlock:^id(BFTask *task){ [self testAuth]; return nil; }]; 我的DeveloperAuthenticatedIdentityProvider代码(BusytimeAuthenticated): #import "BusytimeAuthenticated.h" […]

parsingSwiftlogin错误:无效的用户凭据

我正在尝试使用myname / mypass的现有用户名/密码login到Parse,但是我一直收到错误代码101,无效的login凭证。 我知道myname / mypass的作品,因为我能够使用signUp函数来创build这个用户,并照常进入应用程序。 我也可以在Parse web界面上看到这个用户的存在。 我试图从文本字段拉取用户名/密码,并在“myname”/“mypass”中进行硬编码。 一切都是一样的。 @IBAction func loginButtonTapped(sender: AnyObject) { println(userNameTextField.text) //correctly prints the string. println(passwordTextField.text) //correctly prints the string. PFUser.logInWithUsernameInBackground(userNameTextField.text, password:passwordTextField.text) { (user: PFUser?, error: NSError?) -> Void in if user != nil { var currentUser = PFUser.currentuser() println("log in succesful") // this does not print. performSegueWithIdentifier("SegueToHomeScreen", self) // […]

在Firebase Swift 3中以userID添加数据时出错

我试图通过注册用户在Firebase中的相​​应userID添加数据,但它给了我错误“ unexpectedly found nil while unwrapping an optional value ”现在我不知道是什么问题。 但是当我在代码中分别使用没有添加userID代码时,数据被成功添加了。 但是当我添加userID下面的ref然后得到错误。 注册 let userID = FIRAuth.auth()?.currentUser?.uid ref.child("user_registration").child(userID!).setValue(["username": self.fullName.text, "email": self.emailTextField.text,"contact": self.numberText.text, "city": self.myCity.text, "state": self.countryText.text, "gender": genderGroup, "blood": bloodGroup])

转换为Swift 3(Swift和Firebase项目)

我刚刚更新我的Xcode到Xcode8,我已经把项目转换为SWIFT 3。 在这里signIn函数: Firth. Auth()?.signIn(withEmail: self.EmailTF.text!, password: self.PasswordTF.text!, completion: { (user: FIRUser?, error: NSError?) in if let error = error { print(error.localizedDescription) } else { self.ref.child("UserProfile").child(user!.uid).setValue([ "email": self.EmailTF.text!, "name" : self.NameTF.text!, "phone": self.PhoneTF.text!, "city" : self.CityTF.text!, ]) print("Sucess") } }) 我得到这个错误: cannot convert value of type '(FIRUser?, NSError?) -> ()' to expected argument type 'FIRAuthResultCallback?' […]

将个人资料图片设置为Firebase用户的最佳方法是什么?

在我的应用程序中,我使用Firebase用户身份validation(使用电子邮件和密码)注册了用户名和个人资料图片 。 在文档之后,我像这样签署用户: let username = usernameField.text!.trimmingCharacters(in: .whitespacesAndNewlines) let profileImage = profileImageView.image! // Sign up FIRAuth.auth()?.createUser(withEmail: email, password: password, completion: { (user, error) in if user != nil { // Success let changeRequest = user!.profileChangeRequest() changeRequest.displayName = username // changeRequest.photoURL = ? … } else { if error != nil { print(error!.localizedDescription) } } }) […]

使用用户名而不是电子邮件进入ios应用程序和firebase

这是我的情况,我正在使用的Firebase作为一个iOS应用程序的数据库。 用户可以通过电子邮件login: @IBAction func signInButtonPressed(_ sender: UIButton) { if let email = emailField.text, let password = passwordField.text { FIRAuth.auth()?.signIn(withEmail: email, password: password) { (user, error) in if let error = error { let alertController = UIAlertController(title: "Login or password incorrect", message: "", preferredStyle: UIAlertControllerStyle.alert) alertController.addAction(UIAlertAction(title: "OK", style: UIAlertActionStyle.default,handler: nil)) self.present(alertController, animated: true, completion: nil) } […]