Lock-Facebook 2.2.1

Lock-Facebook 2.2.1

测试已测试
Lang语言 Obj-CObjective C
许可证 MIT
发布上次发布2015年10月

Hernan Zalazar维护。



 
依赖项
FBSDKLoginKit~> 4.6
FBSDKCoreKit~> 4.6
Lock/Core~> 1.11
CocoaLumberjack~> 2.0
 

  • Auth0和Hernan Zalazar

Auth0是一个认证代理,支持身份提供者,包括社交媒体和企业身份提供者,如Active Directory、LDAP、Google Apps和Salesforce。

Lock-Facebook帮助您将原生登录与Facebook iOS SDKLock集成

需求

iOS 7+

安装

Lock-Facebook可通过CocoaPods获取。安装它,只需在Podfile中添加以下行

pod "Lock-Facebook", "~> 2.1"

在开始使用Lock-Facebook之前

为了对Facebook进行认证,您需要在Facebook开发者门户中注册您的应用程序。我们建议您遵循他们的快速入门指南以使用iOS。

如果您已经有了FacebookAppID,那么在您的项目Info.plist文件中添加以下条目

  • FacebookAppId: YOUR_FACEBOOK_APP_ID
  • FacebookDisplayName: YOUR_FACEBOOK_DISPLAY_NAME

然后注册一个自定义URL类型,格式为fb

以下是在您的Info.plist文件中条目应如何显示的示例

FB 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"])

自定义Facebook连接

A0FacebookAuthenticator *facebook = [A0FacebookAuthenticator newAuthenticatorWithDefaultPermissionsForConnectionName:@"custom-connection-name"];
let facebook = A0FacebookAuthenticator.newAuthenticatorWithDefaultPermissionsForConnectionName("custom-connection-name")

有关Lock-Facebook API的更多信息,请参阅CocoaDocs。

问题报告

如果您发现了一个错误或有功能请求,请在此存储库问题部分报告它们。请勿在公共GitHub问题跟踪器上报告安全漏洞。有关披露安全问题的负责任披露计划详细说明了程序。

什么是Auth0?

Auth0可以帮助您:

  • 添加多个认证来源进行身份验证,例如以下社交平台:谷歌、Facebook、微软账户、领英、GitHub、Twitter、Box、Salesforce等,或者企业身份系统如:Windows Azure AD、谷歌应用、活动目录、ADFS或任何SAML身份提供者
  • 通过传统的用户名/密码数据库进行身份验证。
  • 支持将不同用户账户与同一用户关联。
  • 支持生成已签名的Json Web Tokens,以安全地调用API和传输用户身份。
  • 分析用户登录的时间、地点和方式。
  • 通过JavaScript规则从其他来源拉取数据,并将其添加到用户配置文件中。

在Auth0中创建免费账户

  1. 访问Auth0并点击注册。
  2. 使用谷歌、GitHub或微软账户登录。

作者

Auth0

许可

Lock-Facebook可在MIT许可下使用。有关更多信息,请参阅许可文件