A quick and simple way to authenticate a Box user in your iPhone or iPad app.

Overview

BoxSimpleOAuth Bitrise Cocoapod Version Carthage Compatible Cocoapod Platform License

A quick and simple way to authenticate a Box user in your iPhone or iPad app.

iPhone 7 Screenshot iPad Pro 9.7 Screenshot

Adding BoxSimpleOAuth to your project

CocoaPods

CocoaPods is the recommended way to add BoxSimpleOAuth to your project.

  1. Add BoxSimpleOAuth to your Podfile pod 'BoxSimpleOAuth'.
  2. Install the pod(s) by running pod install.
  3. Add BoxSimpleOAuth to your files with #import <BoxSimpleOAuth/BoxSimpleOAuth.h>.

Carthage

  1. Add github "rbaumbach/BoxSimpleOAuth" to your Cartfile.
  2. Follow the directions to add the dynamic framework to your target.

Clone from Github

  1. Clone repository from github and copy files directly, or add it as a git submodule.
  2. Add all files from 'Source' directory to your project.

How To

  • Create an instance of BoxSimpleOAuthViewController and pass in an Box client ID, client secret, client callback URL and completion block to be executed with BoxLoginResponse and NSError arguments.
  • Once the instance of BoxSimpleOAuthViewController is presented (either as a modal or pushed on the navigation stack), it will allow the user to login. After the user logs in, the completion block given in the initialization of the view controller will be executed. The argument in the completion block, BoxLoginResponse, contains an accessToken and other login information for the authenticated user provided by Box API Response. If there is an issue attempting to authenticate, an error will be given instead.
  • By default, if there are issues with authentication, an UIAlertView will be given to the user. To disable this, and rely on the NSError directly, set the property shouldShowErrorAlert to NO.
  • An access_token can be refreshed using the underlying BoxAuthenticationManager.
  • Note: Even though an instance of the view controller itself can be initialized without client ID, client secret, client callback and completion block (to help with testing), this data must be set using the view controller's properties before it is presented to the user.

Example Usage

// Simplest Example:

BoxSimpleOAuthViewController
    *viewController = [[BoxSimpleOAuthViewController alloc] initWithClientID:@"panchos_client_id"
                                                                clientSecret:@"shhhhhh, I'm a secret"
                                                                 callbackURL:[NSURL URLWithString:@"http://chihuahuas.dog"]
                                                                  completion:^(BoxLoginResponse *response, NSError *error) {
                                                                      NSLog(@"My Access Token is: %@", response.accessToken);
                                                                  }];
[self.navigationController pushViewController:viewController
                                     animated:YES];

// Disable error UIAlertViews Example:

BoxSimpleOAuthViewController
    *viewController = [[BoxSimpleOAuthViewController alloc] initWithClientID:@"pancho_jrs_client_id"
                                                                clientSecret:@"shhhhhh, I'm a secret"
                                                                 callbackURL:[NSURL URLWithString:@"http://your.fancy.site"]
                                                                  completion:^(BoxLoginResponse *response, NSError *error) {
                                                                      NSLog(@"My OAuth Token is: %@", response.accessToken);
                                                                  }];
viewController.shouldShowErrorAlert = NO;

[self.navigationController pushViewController:viewController
                                     animated:YES];

Testing

This project has been setup to use fastlane to run the tests.

First, run the setup.sh script to bundle required gems and CocoaPods when in the project directory:

$ ./setup.sh

And then use fastlane to run all the specs on the command line:

$ bundle exec fastlane specs

Version History

Version history can be found on releases page.

Suggestions, requests, and feedback

Thanks for checking out BoxSimpleOAuth for your in-app Box Authentication. Any feedback can be can be sent to: [email protected].

You might also like...
A simple OAuth library for iOS with a built-in set of providers
A simple OAuth library for iOS with a built-in set of providers

SwiftyOAuth is a small OAuth library with a built-in set of providers and a nice API to add your owns. let instagram: Provider = .instagram(clientID:

A simple library to make authenticating tvOS apps easy via their iOS counterparts.

Voucher The new Apple TV is amazing but the keyboard input leaves a lot to be desired. Instead of making your users type credentials into their TV, yo

Simple OAuth2 library with a support of multiple services.

Simple OAuth2 library with a support of multiple services.

A simple to use, standard interface for authenticating to oauth 2.0 protected endpoints via SFSafariViewController.
A simple to use, standard interface for authenticating to oauth 2.0 protected endpoints via SFSafariViewController.

AuthenticationViewController A simple to use, standard interface for authenticating to OAuth 2.0 protected endpoints via SFSafariViewController. Instr

A simple project for Face ID Authentication for iOS device using LocalAuthentication Framework

BiometricAuthentication This respository is a simple project for Face ID Authentication for iOS device using LocalAuthentication Framework and infoPli

OAuth2 framework for macOS and iOS, written in Swift.
OAuth2 framework for macOS and iOS, written in Swift.

OAuth2 OAuth2 frameworks for macOS, iOS and tvOS written in Swift 5.0. ⤵️ Installation 🛠 Usage 🖥 Sample macOS app (with data loader examples) 📖 Tec

Swift based OAuth library for iOS and macOS
Swift based OAuth library for iOS and macOS

OAuthSwift Swift based OAuth library for iOS and macOS. Support OAuth1.0, OAuth2.0 Twitter, Flickr, Github, Instagram, Foursquare, Fitbit, Withings, L

SwiftCoreDataLoginPage - Login and registration with core data
SwiftCoreDataLoginPage - Login and registration with core data

Login and Registration Page with CoreData In this basic project, which was used

A quick and simple way to authenticate an Instagram user in your iPhone or iPad app.
A quick and simple way to authenticate an Instagram user in your iPhone or iPad app.

InstagramSimpleOAuth A quick and simple way to authenticate an Instagram user in your iPhone or iPad app. Adding InstagramSimpleOAuth to your project

A quick and simple way to authenticate a Dropbox user in your iPhone or iPad app.
A quick and simple way to authenticate a Dropbox user in your iPhone or iPad app.

DropboxSimpleOAuth A quick and simple way to authenticate a Dropbox user in your iPhone or iPad app. Adding DropboxSimpleOAuth to your project CocoaPo

Currency Converter - Free and Quick Converter calculates money quick and easy way to see live foreign exchange rates.
Currency Converter - Free and Quick Converter calculates money quick and easy way to see live foreign exchange rates.

Currency Converter - Free and Quick Converter calculates money quick and easy way to see live foreign exchange rates. This app is available in the App

CodeBucket is the best way to browse and maintain your Bitbucket repositories on any iPhone, iPod Touch, and iPad device!
CodeBucket is the best way to browse and maintain your Bitbucket repositories on any iPhone, iPod Touch, and iPad device!

CodeBucket Description CodeBucket is the best way to browse and maintain your Bitbucket repositories on any iPhone, iPod Touch, and iPad device! Keep

JustPersist is the easiest and safest way to do persistence on iOS with Core Data support out of the box.
JustPersist is the easiest and safest way to do persistence on iOS with Core Data support out of the box.

JustPersist JustPersist is the easiest and safest way to do persistence on iOS with Core Data support out of the box. It also allows you to migrate to

InstagramLogin allows iOS developers to authenticate users by their Instagram accounts.
InstagramLogin allows iOS developers to authenticate users by their Instagram accounts.

InstagramLogin handles all the Instagram authentication process by showing a custom UIViewController with the login page and returning an access token that can be used to request data from Instagram.

An iOS application that uses Geo Locattion to allow students to authenticate their fingerprint in school grounds.
An iOS application that uses Geo Locattion to allow students to authenticate their fingerprint in school grounds.

WHUT-GeoLocation An iOS application that uses Geo Locattion to allow students to authenticate their fingerprint in school grounds. Has a form for cont

RNH Tracker is a GPS logger for iOS (iPhone, iPad, iPod) Track your location and send your logs to RNH Regatta :-)

RNH Tracker for iOS + WatchOS RNH Tracker is a GPS logger for iOS (iPhone, iPad, iPod) with offline map cache support. Track your location, add waypoi

The best way to watch Put.io on iPhone and iPad

The best way to watch Put.io on iPhone and iPad

Card Decks is a small utility application for your iPhone, iPod touch and iPad which brings you simple, configurable, colored, multi-line text cards that are grouped into card decks

Card Decks is a small utility application for your iPhone, iPod touch and iPad which brings you simple, configurable, colored, multi-line text cards that are grouped into card decks.

iCloud Drive is Apple's essential connection between all your devices, Mac, iPhone, iPad, even your Windows PC.
iCloud Drive is Apple's essential connection between all your devices, Mac, iPhone, iPad, even your Windows PC.

iCloud Drive is Apple's essential connection between all your devices, Mac, iPhone, iPad, even your Windows PC.While the cost of storage seems expensive in comparison to other online storage services, its advantage is that it works natively across all your devices.

Comments
  • Update project

    Update project

    Update gems, pods, Carthage's, and update Xcode project. Change CircleCI to Bitrise, and remove Codecov.

    Note: Some specs are crashing that need to be resolved.

    opened by rbaumbach 0
  • Correct the spelling of CocoaPods in README

    Correct the spelling of CocoaPods in README

    This pull requests corrects the spelling of CocoaPods 🤓 https://github.com/CocoaPods/shared_resources/tree/master/media

    opened by ReadmeCritic 0
  • Bump excon from 0.67.0 to 0.71.0

    Bump excon from 0.67.0 to 0.71.0

    Bumps excon from 0.67.0 to 0.71.0.

    Changelog

    Sourced from excon's changelog.

    0.71.0 2019-12-12

    fix for leftover data with interrupted persistent connections

    0.70.0 2019-12-02

    Update bundled certificates

    0.69.1 2019-11-21

    Fix mistake in proxy connection error handling

    0.69.0 2019-11-21

    Raise better proxy connection errors

    0.68.0 2019-10-25

    Updated bundled certs

    Commits
    • 1149d44 v0.71.0
    • ccb57d7 fix for leftover data with interrupted persistent connections
    • f8de8cf v0.70.0
    • 93f4a21 v0.69.1
    • e89bbb7 Merge pull request #709 from jasquat/fix_response_status_check
    • 5647437 fixed response status check when making a request with a valid proxy is set
    • f769176 v0.69.0
    • 20c0748 define ProxyConnectionError
    • f44106a raise on failed proxy connect
    • d7ed5fe be thorough in unsubscribing to notifications in instrumentation tests
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot ignore this [patch|minor|major] version will close this PR and stop Dependabot creating any more for this minor/major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
Releases(0.2.1)
Owner
Ryan Baumbach
A native California Chicano, forged in the fires of Silicon Valley who is learning more about life in Colorado.
Ryan Baumbach
A quick and simple way to authenticate a Dropbox user in your iPhone or iPad app.

DropboxSimpleOAuth A quick and simple way to authenticate a Dropbox user in your iPhone or iPad app. Adding DropboxSimpleOAuth to your project CocoaPo

Ryan Baumbach 42 Dec 29, 2021
InstagramLogin allows iOS developers to authenticate users by their Instagram accounts.

InstagramLogin handles all the Instagram authentication process by showing a custom UIViewController with the login page and returning an access token that can be used to request data from Instagram.

Ander Goig 67 Aug 20, 2022
LoginKit is a quick and easy way to add Facebook and email Login/Signup UI to your app.

LoginKit About LoginKit is a quick and easy way to add Facebook and email Login/Signup UI to your app. If you need to quickly prototype an app, create

Icalia Labs 653 Dec 17, 2022
A simple way to implement Facebook and Google login in your iOS apps.

Simplicity Simplicity is a simple way to implement Facebook and Google login in your iOS apps. Simplicity can be easily extended to support other exte

Simplicity Mobile 681 Dec 18, 2022
Implementing User Authentication with Sign in with Apple

Implementing User Authentication with Sign in with Apple Provide a way for users of your app to set up an account and start using your services. Overv

null 0 Oct 18, 2021
Implementing User Authentication with Sign in with Apple

Implementing User Authentication with Sign in with Apple Provide a way for users of your app to set up an account and start using your services. Overv

Liselot 0 Dec 2, 2021
LinkedInSignIn - Simple view controller to log in and retrieve an access token from LinkedIn.

LinkedInSignIn Example To run the example project, clone the repo, and run pod install from the Example directory first. Also you need to setup app on

Serhii Londar 34 Sep 1, 2022
Example of simple OAuth2 authentication using Alamofire 5 and RxSwift library

REST Client based on Alamofire 5 and RxSwift library. Supports OAuth2 and Basic authentication interceptor.

Tomáš Smolík 3 Dec 8, 2022
ReCaptcha - Add Google's Invisible ReCaptcha v2 to your project

Add Google's Invisible ReCaptcha v2 to your project. This library automatically handles ReCaptcha's events and retrieves the validation token or notifies you to present the challenge if invisibility is not possible.

Flávio Caetano 250 Dec 5, 2022
Krypton turns your iOS device into a WebAuthn/U2F Authenticator: strong, unphishable 2FA.

Krypton turns your iOS device into a WebAuthn/U2F Authenticator: strong, unphishable 2FA. Krypton implements the standardized FIDO Universal 2nd Facto

krypt.co 332 Nov 5, 2022