FullAuthIOSClient 1.0.7

FullAuthIOSClient 1.0.7

TestsTested
LangLanguage SwiftSwift
License MIT
ReleasedLast Release Apr 2020
SPMSupports SPM

Maintained by karthik, sathishvgs.



  • By
  • Karthik samy

FullAuthIOSClient

Build Status Version License Platform

Supported Operations

Requirements

  • iOS 10.0+
  • Xcode 11+
  • Swift 4.2+

Latest Version

1.0.1 is the current latest version For change logs refer Releases

Installation

FullAuthIOSClient is available through CocoaPods. To install it, simply add the following line to your Podfile:

CocoaPods

pod "FullAuthIOSClient"

Swift Package Manager

FullAuthIOSClient is available through Swift Package Manager. To install it, simply add the following dependency to your Package.swift

.package(url: "https://github.com/Adaptavant/fullauth-api-ios-client.git", from: "1.0.1")

Requesting Access Token

There are few supported flows in the fullAuth specification to request access token as follows

Create an authService by providing the necessary inputs.

let authService =  FullAuthOAuthService(appMode: AppMode.live, authDomain: "your auth domain":, clientId: "client-id", clientSecret: "client-secret")

Using Resource Owner Credentials

A Resource Owner’s username and password are submitted as part of the request, and a token is issued upon successful authentication.

do {
    try authService.requestAccessTokenForResourceCredentials("user-email-id", password: "password", scope: ["scope1", "scope2"], accessType: .OFFLINE, handler: { (error, errorResponse, accessToken) -> Void in
    // process full auth response
         })
    } catch let err {
             // handle error 
    }

Using Google Access Token

Request AccessToken by passing valid google access token.

 do {
     try authService.requestAccessTokenForGoogleToken(googleAccessToken: "googleToken", scope: ["scope1", "scope2"], accessType: .OFFLINE, handler: { (error, errorResponse, accessToken) in
                   // process the response
               })
    } catch let err {
             // handle the error 
    }

Using Facebook Access Token

Request AccessToken by passing valid facebook access token.

do {
    try authService.requestAccessTokenForGoogleToken(faceBookAccessToken: "facebookToken", scope: ["scope1", "scope2"], accessType: .OFFLINE, handler: { (error, errorResponse, accessToken) in
                  // process the response
              })
   } catch let err {
            // handle the error 
   }

Using Apple Access Token

Request AcccessToken by passing valid Apple identity token and Bundle Id

do {
   try authService.requestAccessTokenForAppleToken(appleToken: "AppleIdentityToken", appBundleId: "Bundle_Id", scope: ["scope1", "scope2"], accessType: .OFFLINE, handler: { (error, errorResponse, accessToken) in
                 // process the response
             })
  } catch let err {
           // handle the error 
  }

Fetch access token information

Access token information can be obtained by the following method.

do {
    try authService.getTokenInfo("pass the accessToken") { (err, errResponse, token) in
            // token information is received here
        }
    } catch {
            // handle the error
    }

Refresh Access Token

You can submit a refresh token and receive a new access token if the access token had expired.

 do {
     try authService.refreshAccessToken("your refreshToken", expiryType: OauthExpiryType.LONG) { (error, errorResponse, accessToken) -> Void in
            // Save the access token
    } catch let error {
            // print("error: \(error)")
    }

Revoke Access Token

Revoke a valid AccessToken.

 do {
     try authService.revokeToken(token: "your token", tokenType: RevokeTokenHintType.ACCESS_TOKEN) { (success, err, errResp) in
               // success for revoking the access token
     } catch {
          // print error
     }

Author

karthik-dev Monica Raja

License

FullAuthIOSClient is available under the MIT license. See the LICENSE file for more info.