TestsTested | ✗ |
LangLanguage | Obj-CObjective C |
License | MIT |
ReleasedLast Release | Dec 2016 |
Maintained by Hernan Zalazar.
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
iOS 9+
The Lock-Twitter is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "Lock-Twitter", "~> 2.0"
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
NSString *twitterApiKey = ...
A0TwitterAuthenticator *twitter = [A0TwitterAuthenticator newAuthenticationWithConsumerKey:twitterApiKey];
let twitterApiKey = ... //Remember to obfuscate your api key
let twitter = A0TwitterAuthenticator.newAuthentication(withConsumerKey: twitterApiKey)
and register it with your instance of A0Lock
if native integration is available
A0Lock *lock = ... //Get your instance of A0Lock
if ([A0TwitterAuthenticator canUseNativeTwitterAuthentication]) {
[lock registerAuthenticators:@[twitter]];
}
let lock = ... //Get your instance of A0Lock
if A0TwitterAuthenticator.canUseNativeTwitterAuthentication() {
lock.registerAuthenticators([twitter])
}
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:
+ (BOOL)canUseNativeTwitterAuthentication;
Checks if it twitter native integration is available in the device.
BOOL canUse = [A0TwitterAuthenticator canUseNativeTwitterAuthentication];
let canUse = A0TwitterAuthenticator.canUseNativeTwitterAuthentication()
+ (A0TwitterAuthenticator *)newAuthenticatorWithConsumerKey:(NSString *)key;
Create a new 'A0TwitterAuthenticator' using a Twitter API key for the default twitter connection name.
A0TwitterAuthenticator *twitter = [A0TwitterAuthenticator newAuthenticatorWithConsumerKey:@"KEY"];
let twitter = A0TwitterAuthenticator.newAuthenticator(withConsumerKey: "KEY")
+ (A0TwitterAuthenticator *)newAuthenticatorWithConnectionName:(NSString *)connectionName consumerKey:(NSString *)consumerKey;
Create a new 'A0TwitterAuthenticator' using a Twitter API key and a connection name.
A0TwitterAuthenticator *twitter = [A0TwitterAuthenticator newAuthenticatorWithConnectionName:@"my-twitter" consumerKey:@"KEY"];
let twitter = A0TwitterAuthenticator.newAuthenticator(withConnectionName: "my-twitter", consumerKey: "KEY")
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.
Auth0 helps you to:
Lock-Twitter is available under the MIT license. See the LICENSE file for more info.