Coder Social home page Coder Social logo

cybernhl / google-auth-library-swift Goto Github PK

View Code? Open in Web Editor NEW

This project forked from googleapis/google-auth-library-swift

0.0 1.0 0.0 164 KB

Auth client library for Swift command-line tools and cloud services. Supports OAuth1, OAuth2, and Google Application Default Credentials.

License: Apache License 2.0

Swift 91.27% Makefile 0.13% Ruby 2.08% JavaScript 6.51%

google-auth-library-swift's Introduction

Swift Actions Status

Auth Library for Swift

This project contains Swift packages that can be used to write command-line tools and cloud services that use OAuth to authenticate and authorize access to remote services.

Currently these packages support OAuth1 and OAuth2. They are designed to work on OS X systems and on Linux systems that are running in the Google Cloud.

  • On OS X systems, OAuth tokens can be obtained using the locally-installed browser and a local web server that is automatically run in the command-line client.

  • On Linux systems, OAuth tokens can be obtained automatically from the Google Cloud Metadata Service.

  • On both Linux and OS X systems, OAuth tokens can be obtained automatically for Google Cloud Service Accounts.

Usage and Examples

Sources/Examples contains examples that illustrate OAuth1 and OAuth2 signin for various services. Each requires valid application credentials to run. See the various service providers for details.

The BrowserTokenProvider classes use a local web server to implement "three-legged OAuth" signin in which users grant permission in a browser that a provider's server redirects to the client server with a code. These providers look for OAuth configuration information in "credentials" YAML files that are expected to be in $HOME/.credentials. Sample credentials files are in credentials and include client IDs, client secrets, and OAuth service URLs. When OAuth services require registered callback URLs, these should be set to http://localhost:8080/SERVICE/callback where SERVICE is specified in the corresponding credentials YAML file. The temporary web server runs locally on port 8080.

Credits

  • The local web server is built using swift-nio/http.
  • HMAC and SHA1 hashing is performed using CryptoSwift.
  • RSA signing of service account JWT tokens uses BigInt.

Disclaimer

This is work in progress toward great server-side Swift software. Please take care when using this in production projects: always refer to a tagged version and be aware that interfaces may change in future releases.

Contributing

We'd love to collaborate on this. See CONTRIBUTING.md for details.

Copyright

Copyright 2019, Google LLC.

License

Released under the Apache 2.0 license.

google-auth-library-swift's People

Contributors

0xced avatar alexlaurinmath avatar barrault01 avatar dlewanda avatar jgh- avatar justinbeckwith avatar kant avatar marcocanc avatar renovate-bot avatar santhoshvaddi avatar timburks avatar

Watchers

 avatar

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.