Giter VIP home page Giter VIP logo

android-auth's Introduction

Spotify Auth Library

Maven Central

This repository is now a part of spotify/android-sdk. Please post new issues there!

This library is responsible for authenticating the user and fetching the authorization code/access token that can subsequently be used to play music or in requests to the Spotify Web API.

Breaking changes in Spotify Auth library version 2.0.0

In this version we replaced use of WebView with Custom Tabs since Google and Facebook Login no longer support WebViews for authenticating users.

As part of this change the library API does not contain AuthorizationClient#clearCookies method anymore. Custom Tabs use the cookies from the browser.

Integrating the library into your project

To add this library to your project add following dependency to your app build.gradle file:

implementation "com.spotify.android:auth:<version>"

Since April 2021 we're publishing the library on MavenCentral instead of JCenter. Therefore to be able to get the library dependency, you should add MavenCentral into repositories block:

repositories {
    mavenCentral()
    ...
}

Since Spotify Auth library version 2.0.0 you also need to provide the scheme and host of the redirect URI that your app is using for authorizing in your app build.gradle file. Below is an example of how this looks for the auth sample project using spotify-sdk://auth redirect URI:

    defaultConfig {
        manifestPlaceholders = [redirectSchemeName: "spotify-sdk", redirectHostName: "auth"]
        ...
    }

To learn more see the Authentication Guide and the API reference.

Flavors

Since Spotify Auth library version 2.1.0, two versions of the library are provided that differs in their behaviour if the Spotify application cannot be used to login:

  • auth - Opens the web browser to login to Spotify
  • store - Redirects to the Android Play store to download the Spotify application

Sample Code

Checkout the sample project.

Contributing

You are welcome to contribute to this project. Please make sure that:

  • New code is test covered
  • Features and APIs are well documented
  • ./gradlew check must succeed

Code of conduct

This project adheres to the Open Code of Conduct. By participating, you are expected to honor this code.

android-auth's People

Contributors

veronikapetruskova avatar mdelolmo avatar kundzi avatar cedrich3 avatar swbain avatar erikghonyan avatar pimpimmi avatar erdtman avatar fensterzumberg avatar jgabrielfreitas avatar cortinico avatar perploug avatar bgermann 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.