Tag: authentication

在Swift中使用WKWebView进行身份validation

在我的iOS应用程序中,我想使用WKWebView在应用程序中封装外部URL。 这个URL需要基本的authentication(它需要用户和密码凭证,就像下面的截图一样)。 经过一番调查,我试图使用didReceiveAuthenticationChallenge方法,为了启用一个自动login,所以我不理解它是如何工作的。 这是我的代码。 import UIKit import WebKit class WebViewController: UIViewController, WKNavigationDelegate { var webView: WKWebView? private var request : NSURLRequest { let baseUrl = "https://unimol.esse3.cineca.it/auth/Logon.do" let URL = NSURL(string: baseUrl)! return NSURLRequest(URL: URL) } /* Start the network activity indicator when the web view is loading */ func webView(webView: WKWebView, didStartProvisionalNavigation navigation: WKNavigation){ UIApplication.sharedApplication().networkActivityIndicatorVisible […]

Firebase 3.x – Facebooklogin

在Firebase 2.5.1 ,我曾经这样做过,它正在工作: @IBAction func facebookLoginDidTouch(sender: AnyObject) { let facebookLogin = FBSDKLoginManager() facebookLogin.logInWithReadPermissions(["public_profile", "email"], fromViewController: self, handler: { (facebookResult, facebookError) -> Void in if facebookError != nil { print("Facebook login failed. Error \(facebookError)") } else if facebookResult.isCancelled { print("Facebook login was cancelled.") } else { let accessToken = FBSDKAccessToken.currentAccessToken().tokenString myRootRef.authWithOAuthProvider("facebook", token: accessToken, withCompletionBlock: { error, […]

在您的项目中找不到有效的GoogleService-Info.plist

当我用Xcode 9 beta 4运行我的swift 3.2代码时,这是我得到的错误: *** Terminating app due to uncaught exception 'com.firebase.core', reason: '[FIRApp configure]; (FirebaseApp.configure() in Swift) could not find a valid GoogleService-Info.plist in your project. Please download one from https://console.firebase.google.com/.' 我已经有一个GoogleService-Info.plist文件,它的名字完全和它应该一样,并且是有效的。 有没有试用firebase或类似的东西?

如何获取ios中的twitter个人资料图片?

我写了下面的代码: NSURL *url = [NSURL URLWithString:@"http://api.twitter.com/1.1/users/show.json"]; NSDictionary *params = [NSDictionary dictionaryWithObjectsAndKeys:username, @"screen_name" ,[[controller.engine accessToken] secret]]; TWRequest *request = [[TWRequest alloc] initWithURL:url parameters:params requestMethod:TWRequestMethodGET]; [request performRequestWithHandler: ^(NSData *responseData, NSHTTPURLResponse *urlResponse, NSError *error) { if (responseData) { NSDictionary *user = [NSJSONSerialization JSONObjectWithData:responseData options:NSJSONReadingAllowFragments error:NULL]; NSString *profileImageUrl = [user objectForKey:@"profile_image_url"]; NSLog(@"%@",profileImageUrl); } }]; 但我总是最终得到一个Bad authentication错误。 我觉得我失去了一些东西。 任何人都请检查我的代码? 或提供任何build议来检索Twitter用户个人资料图片? […]

在iOS上存储身份validation令牌

我正在构build一个iOS应用程序,用户使用我的Web服务进行身份validation。 我不希望他们每次启动应用程序(令牌持续一个月)login。 所以我想把这个caching在设备的某个地方。 安全地做到这一点的最佳方法是什么? 我可以只依靠应用程序保持暂停状态,并将令牌保存在“内存”中吗?

Swift iOS客户端证书authentication

我想要使​​用的Web服务需要客户端证书。 我怎样才能发送我的证书呢? 为了进一步阐述我不明白如何创buildSecIdentityRef 。 在NSURLConnection didReceiveAuthenticationChallenge我在ServerTrust之后得到了这个条件: else if challenge?.protectionSpace.authenticationMethod == NSURLAuthenticationMethodClientCertificate { var secIdent : SecIdentityRef = ????????? var certCred = NSURLCredential(identity: secIdent, certificates: [getClientCertificate()], persistence: NSURLCredentialPersistence.Permanent) challenge?.sender.useCredential(certCred, forAuthenticationChallenge: challenge!) } getClientCertificate方法: func getClientCertificate() -> SecCertificateRef { let mainBundle : NSBundle = NSBundle.mainBundle() var mainBund = mainBundle.pathForResource("iosClientCert", ofType: "cer") //exported the cert in der format. […]

如何在用户的消息框中直接在iPhone中填充OTP?

我正在使用其移动和iPhone应用程序的互联网交易应用程序。 随着最近的市场趋势,我们正在努力包括双因素authentication。 为此,我们将在用户的注册手机号码上发送一次性短信作为短信。 有没有办法,OTP可以从iPhone的用户消息框中自动填充到应用程序中? 我应该使用什么algorithm让我的应用程序读取用户的消息框? 提前致谢:)

读取Firebase身份validation错误(Firebase 3.x和Swift)

我无法弄清楚如何在新版本的Firebase中读取FIRAuthErrorNameKey。 以下是我到目前为止,但“let errorCode = FIRAuthErrorNameKey”行是​​不正确的。 从阅读Firebase文档,我也尝试访问userInfo中的错误代码,但没有成功,没有想法。 // Send request to Firebase to add user to register user FIRAuth.auth()?.createUserWithEmail(emailTextField.text!, password: passwordTextField.text!, completion: { (user, error) in // Check for errors and respond to user accordingly. if error != nil { let errorCode = FIRAuthErrorNameKey switch errorCode { case "FIRAuthErrorCodeEmailAlreadyInUse": // Add logic accordingly case …: // […]

iOS Dropbox SDK – 无法上传或获取元数据

这个应用程序用来正常工作,但现在我不能上传文件或获取元数据。 每当我尝试上传,我会得到 File upload failed with error: Error Domain=dropbox.com Code=401 "The operation couldn't be completed. (dropbox.com error 401.)" 但是,当试图获取元数据,我会得到 Error loading metadata: Error Domain=dropbox.com Code=403 "The operation couldn't be completed. (dropbox.com error 403.)" 我一直在尝试重新进行身份validation,但执行unlink命令后似乎没有任何区别。 我试过把这个命令放在不同的地方。 – (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { // Override point for customization after application launch. //[[DBSession sharedSession] unlinkAll]; DBSession *dbSession = […]

Linkedin iOS身份validation需要启动Linkedin应用程序

我有一个问题整合LinkedIn SDK与我的iOS应用程序。 看来authentication过程要求我下载LinkedIn应用程序来连接LinkedIn。 有没有办法使用sdk而无需下载LinkedIn应用程序? 苹果拒绝了这个原因的应用程序。 我非常感谢有关解决此问题的任何提示。 提前致谢