GithubHelp home page GithubHelp logo

approov / appauth-oauth2-approov Goto Github PK

View Code? Open in Web Editor NEW
2.0 10.0 2.0 715 KB

Strengthens OAuth2 authorization by using mobile app attestation

Home Page: https://approov.io

Java 100.00%
mobile mobile-security api-security approov approov-mobile-quickstart

appauth-oauth2-approov's Introduction

Strengthening OAuth2 for Mobile Clients

OAuth2, often combined with OpenID-Connect, is a popular authorization framework that enables applications to protect resources from unauthorized access. It delegates user authentication to an authorization service, which then authorizes third-party applications to access the protected resources on the user’s behalf. OAuth2 provides authorization flows for both web and mobile applications.

OAuth2's most popular flow is the authorization code grant flow which is used to authorize confidential clients access to protected resources. Clients use a client_id to identify themselves and a client_secret to authenticate themselves to the authorization service.

Unfortunately, native mobile clients are not good at keeping static secrets. Since a public client secret is no secret at all, many identity and authorization service providers simply drop the client secret. Either way, without proper client authentication, the OAuth2 flow is subject to code exchange attacks and/or client app impersonation.

A dynamic app authentication service such as Approov, which is freely used in this demo, can be used to reintroduce confidential client authentication into the mobile client OAuth2 flow.

AppAuth

AppAuth is an open source SDK for native Android and iOS apps which implements best-practice OAuth2 and OpenID-Connect (OIDC) specifications in a platform friendly manner.

The SDK follows OAuth 2.0 for Native Apps best practices, including the PKCE extension and custom tab browsers. The library provides hooks to further extend the protocol beyond the basic flow.

As an open source project, AppAuth has GitHub repositories for Android and iOS which include good documentation, a demo app, and integration with multiple authorization services.

Getting Started

A sample app, implemented in Android, provides a concrete example using AppAuth and Approov to authorize access to private resources. The Books App uses the Google Books API and Google Sign-In services to search for books (protected by API key) and show a signed-in user’s favorite book selections (protected by OAuth2). The app was developed on Android to further explore AppAuth SDK usage with a common application architecture and support libraries.

An OAuth2 adapter, implemented in node, is used to add Approov app authentication into the existing Google OAuth2 code grant flow.

To follow along, start by cloning the AppAuth-OAuth2-Approov project on GitHub available at github.com/approov. It requires some configuration, so it will not run out of the box. At a minimum, you will need to provide a keystore, Google API key, and Google OAuth2 credentials.

See the article Strengthening OAuth2 for Mobile at the Approov blog or on Medium for instructions on how to get the app and adpater service running.

appauth-oauth2-approov's People

Contributors

dependabot[bot] avatar exadra37 avatar ivolz avatar richardmtaylor avatar skiph avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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.