auth0/Lock-Twitter.iOS

Name: Lock-Twitter.iOS

Owner: Auth0

Description: Lock for iOS add-on to use Twitter iOS integration

Created: 2015-05-18 20:41:36.0

Updated: 2016-10-26 15:31:19.0

Pushed: 2017-08-09 14:03:27.0

Homepage: https://auth0.com/lock

Size: 104

Language: Objective-C

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Lock-Twitter

CI Status Version License Platform

Auth0 is an authentication broker that supports social identity providers as well as enterprise identity providers such as Active Directory, LDAP, Google Apps and Salesforce.

Lock-Twitter helps you integrate native Login with Twitter and Lock

Usage
Requierements

iOS 9+

Install

The Lock-Twitter is available through CocoaPods. To install it, simply add the following line to your Podfile:

"Lock-Twitter", "~> 2.0"
Usage

Twitter authentication use Reverse Auth to obtain a valid access_token that can be sent to Auth0 Server and validate the user.

First create a new instance of A0TwitterAuthenticator

ring *twitterApiKey = ...
itterAuthenticator *twitter = [A0TwitterAuthenticator newAuthenticationWithConsumerKey:twitterApiKey];
wift
twitterApiKey = ... //Remember to obfuscate your api key
twitter = A0TwitterAuthenticator.newAuthentication(withConsumerKey: twitterApiKey)

and register it with your instance of A0Lock if native integration is available

ck *lock = ... //Get your instance of A0Lock
[A0TwitterAuthenticator canUseNativeTwitterAuthentication]) {
[lock registerAuthenticators:@[twitter]];

wift
lock = ... //Get your instance of A0Lock
0TwitterAuthenticator.canUseNativeTwitterAuthentication() {
lock.registerAuthenticators([twitter])

Localization

For the case when there are more than one twitter account, Lock-Twitter will let the user choose one use an action sheet. Here are the keys you need to add to your Localizable.strings file

Also when there are no accounts, Lock-Twitter will show an alert with an error that can be customizable with the following keys:

API
A0TwitterAuthenticator
A0TwitterAuthenticator#canUseNativeTwitterAuthentication:
OOL)canUseNativeTwitterAuthentication;

Checks if it twitter native integration is available in the device.

 canUse = [A0TwitterAuthenticator canUseNativeTwitterAuthentication];
canUse = A0TwitterAuthenticator.canUseNativeTwitterAuthentication()
A0TwitterAuthenticator#newAuthenticatorWithConsumerKey:
0TwitterAuthenticator *)newAuthenticatorWithConsumerKey:(NSString *)key;

Create a new 'A0TwitterAuthenticator' using a Twitter API key for the default twitter connection name.

itterAuthenticator *twitter = [A0TwitterAuthenticator newAuthenticatorWithConsumerKey:@"KEY"];
twitter = A0TwitterAuthenticator.newAuthenticator(withConsumerKey: "KEY")
A0TwitterAuthenticator#newAuthenticatorWithConnectionName:consumerKey:
0TwitterAuthenticator *)newAuthenticatorWithConnectionName:(NSString *)connectionName consumerKey:(NSString *)consumerKey;

Create a new 'A0TwitterAuthenticator' using a Twitter API key and a connection name.

itterAuthenticator *twitter = [A0TwitterAuthenticator newAuthenticatorWithConnectionName:@"my-twitter" consumerKey:@"KEY"];
twitter = A0TwitterAuthenticator.newAuthenticator(withConnectionName: "my-twitter", consumerKey: "KEY")
Issue Reporting

If you have found a bug or if you have a feature request, please report them at this repository issues section. Please do not report security vulnerabilities on the public GitHub issue tracker. The Responsible Disclosure Program details the procedure for disclosing security issues.

What is Auth0?

Auth0 helps you to:

Create a free account in Auth0
  1. Go to Auth0 and click Sign Up.
  2. Use Google, GitHub or Microsoft Account to login.
Author

Auth0

License

Lock-Twitter is available under the MIT license. See the LICENSE file for more info.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.