Skip to content

Commit

Permalink
Update README.md (#305)
Browse files Browse the repository at this point in the history
* Update README.md

Removed parts that are no longer true after library refactor and cleanup some time ago. Fixed broken link to API reference.
  • Loading branch information
veronikapetruskova committed Aug 27, 2021
1 parent 6ce4fc7 commit cfd6b68
Showing 1 changed file with 5 additions and 39 deletions.
44 changes: 5 additions & 39 deletions auth-lib/README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
# Spotify Authentication Library
# Spotify Auth Library

[![Build Status](https://travis-ci.org/spotify/android-auth.svg?branch=master)](https://travis-ci.org/spotify/android-auth)
[![Maven Central](https://img.shields.io/maven-central/v/com.spotify.android/auth.svg)](https://search.maven.org/search?q=g:com.spotify.android)

This library is responsible for authenticating the user and fetching the access token
that can subsequently be used to play music or in requests to the [Spotify Web API](https://developer.spotify.com/web-api/).
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](https://developer.spotify.com/web-api/).

# Integrating the library into your project

Expand All @@ -22,53 +21,20 @@ repositories {
}
```

To learn more about working with authentication see the
[Authentication Guide](https://developer.spotify.com/technologies/spotify-android-sdk/android-sdk-authentication-guide/)
and the [API reference](https://developer.spotify.com/android-sdk-docs/authentication) on the developer site.
To learn more see the [Authentication Guide](https://developer.spotify.com/technologies/spotify-android-sdk/android-sdk-authentication-guide/)
and the [API reference](https://spotify.github.io/android-sdk/auth-lib/docs/index.html).

The following entries are merged into your manifest when you add the libary:

```xml
<uses-permission android:name="android.permission.INTERNET"/>

<activity
android:exported="true"
android:name="com.spotify.sdk.android.authentication.AuthCallbackActivity"
android:theme="@android:style/Theme.Translucent.NoTitleBar">

<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>

<data
android:scheme="@string/com_spotify_sdk_redirect_scheme"
android:host="@string/com_spotify_sdk_redirect_host"/>
</intent-filter>
</activity>

<activity
android:name="com.spotify.sdk.android.authentication.LoginActivity"
android:name="com.spotify.sdk.android.auth.LoginActivity"
android:theme="@android:style/Theme.Translucent.NoTitleBar">
</activity>
```

You will need to add the following strings to your project to enable Chrome CustomTabs
login flow:

```xml
<resources>
<string name="com_spotify_sdk_redirect_scheme">yourscheme</string>
<string name="com_spotify_sdk_redirect_host">yourhost</string>
</resources>
```

So, if you provided `bestapp://ismyapp` as a redirect URI in [the developer console](https://developer.spotify.com/my-applications/#!/applications)
then you set `com_spotify_sdk_redirect_scheme` to `bestapp` and `com_spotify_sdk_redirect_host` to `ismyapp`.

Since Chrome CustomTabs share credentials with the Chrome instance you have installed
you get much better experience logging users in compare to WebView flow.

# Sample Code

Checkout [the sample project](https://github.com/spotify/android-sdk/tree/master/auth-sample).
Expand Down

0 comments on commit cfd6b68

Please sign in to comment.