GithubHelp home page GithubHelp logo

raulriera / authenticationviewcontroller Goto Github PK

View Code? Open in Web Editor NEW
257.0 257.0 14.0 177 KB

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

License: MIT License

Swift 67.46% Objective-C 4.44% Ruby 28.10%
authentication oauth sfsafariviewcontroller swift

authenticationviewcontroller's People

Contributors

raulriera avatar readmecritic avatar regnerjr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

authenticationviewcontroller's Issues

Google implementation connector for OAuth2

Here I share the connector for Google OAuth2 with an usage example (hope its help):

OAuthGoogle.swift

static let ClientId = "188766122934-0t21j64fd4qmcomewpho6jeqwxe6kpwq.apps.googleusercontent.com"
static let ClientSecret = "AIza34De1h2JIehyugxcgYnXewtokGdi0xXPsJMTY"
    
static let ScopeYoutubeReadonly = "https://www.googleapis.com/auth/youtube.readonly"
static let ScopeUserinfoEmail = "https://www.googleapis.com/auth/userinfo.email"
static let ScopeUserinfoProfile = "https://www.googleapis.com/auth/userinfo.profile"
let provider = OAuthGoogle(clientId: ServiceRequest.ClientId, clientSecret: "", scopes: [ServiceRequest.ScopeUserinfoEmail, ServiceRequest.ScopeUserinfoProfile, ServiceRequest.ScopeYoutubeReadonly])
let authenticationViewController = AuthenticationViewController(provider: provider)
authenticationViewController.failureHandler = { error in
	print(error)
}
authenticationViewController.authenticationHandler = { token in
	print (token)
	authenticationViewController.dismiss(animated: true, completion: nil)
}
present(authenticationViewController, animated: true, completion: nil)

Can't receive access_token

Does it work correctly fro Twitter/Facebook or Google+ ?
Can't manage any of them.
Can anyone provide an example with those networks?
e.g. I have following url for twitter:
"https://api.twitter.com/oauth/authorize/?client_id=\(clientId)&scope=\(scopes.joined(separator: "+"))&redirect_uri=(redirectURI)&response_type=code"
accessTokenURL = https://api.twitter.com/oauth/access_token"

redirectURI = "https://www.google.com"

Then, I put my ClientID and Secret, but nothing works. I can login and do not receive my token after switching to redirectURL.

Coub doesn't work properly

Description for coub:
https://coub.com/dev/docs/Coub+API%2FAuthentication

If you need test credentials:
ID:
60b88af1e39803f5f68716bc364a498f9d4e733a7f76735dc48729e697de3bd6
Secret:
6f62d7366a58b07377a3046922d49c4f5ab882eebe322f50467856bb7b86e049
Redirect URL:
http://gargo.of.by
Permissions:
like+recoub

I used your example and added OAuthCoub (looks like your OAuthDribble and OAuthInstagram) and called it. It seems everything ok with authorization - successfully logged in, and redirected to "Redirect URL". The only main trouble is application:openURL:options: is not called at all and so I don't have a token in my app.

Could you please resolve this strange issue?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.