测试已测试 | ✓ |
Lang语言 | Obj-CObjective C |
许可证 | MIT |
发布上次发布 | 2015年10月 |
由Hernan Zalazar维护。
依赖项 | |
FBSDKLoginKit | ~> 4.6 |
FBSDKCoreKit | ~> 4.6 |
Lock/Core | ~> 1.11 |
CocoaLumberjack | ~> 2.0 |
Auth0是一个认证代理,支持身份提供者,包括社交媒体和企业身份提供者,如Active Directory、LDAP、Google Apps和Salesforce。
Lock-Facebook帮助您将原生登录与Facebook iOS SDK和Lock集成
iOS 7+
Lock-Facebook可通过CocoaPods获取。安装它,只需在Podfile中添加以下行
pod "Lock-Facebook", "~> 2.1"
为了对Facebook进行认证,您需要在Facebook开发者门户中注册您的应用程序。我们建议您遵循他们的快速入门指南以使用iOS。
如果您已经有了FacebookAppID,那么在您的项目Info.plist
文件中添加以下条目
YOUR_FACEBOOK_APP_ID
YOUR_FACEBOOK_DISPLAY_NAME
然后注册一个自定义URL类型,格式为fb
。
以下是在您的Info.plist
文件中条目应如何显示的示例
只需创建一个用于默认权限public_profile
的新实例A0FacebookAuthenticator
A0FacebookAuthenticator *facebook = [A0FacebookAuthenticator newAuthenticationWithDefaultPermissions];
let facebook = A0FacebookAuthenticator.newAuthenticatorWithDefaultPermissions()
并将其与您的A0Lock
实例注册
A0Lock *lock = //Get your A0Lock instance
[lock registerAuthenticators:@[facebook]];
let lock:A0Lock = //Get your A0Lock instance
lock.registerAuthenticators([facebook])
创建和注册
A0FacebookAuthenticator
的好地方是AppDelegate
类。
A0FacebookAuthenticator *facebook = [A0FacebookAuthenticator newAuthenticatorWithPermissions:@[@"public_profile", @"email"]];
let facebook = A0FacebookAuthenticator.newAuthenticatorWithPermissions(["public_profile", "email"])
A0FacebookAuthenticator *facebook = [A0FacebookAuthenticator newAuthenticatorWithDefaultPermissionsForConnectionName:@"custom-connection-name"];
let facebook = A0FacebookAuthenticator.newAuthenticatorWithDefaultPermissionsForConnectionName("custom-connection-name")
有关Lock-Facebook API的更多信息,请参阅CocoaDocs。
如果您发现了一个错误或有功能请求,请在此存储库问题部分报告它们。请勿在公共GitHub问题跟踪器上报告安全漏洞。有关披露安全问题的负责任披露计划详细说明了程序。
Auth0可以帮助您:
Auth0
Lock-Facebook可在MIT许可下使用。有关更多信息,请参阅许可文件。