Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions authorization/authorization_code/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Install the app dependencies running:

You will need to register your app and get your own credentials from the [Spotify for Developers Dashboard](https://developer.spotify.com/dashboard).

- Create a new app in the dashboard and add `http://localhost:8888/callback` to the app's redirect URL list.
- Create a new app in the dashboard and add `https://127.0.0.1:8888/callback` to the app's redirect URL list.
- Once you have created your app, update the `client_id`, `redirect_uri`, and `client_secret` in the `app.js` file with the credentials obtained from the app settings in the dashboard.

## Running the example
Expand All @@ -24,4 +24,4 @@ From a console shell:

$ npm start

Then, open `http://localhost:8888` in a browser.
Then, open `https://127.0.0.1:8888/callback` in a browser.
2 changes: 1 addition & 1 deletion authorization/authorization_code/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ var cookieParser = require('cookie-parser');

var client_id = 'yourClientIDGoesHere'; // your clientId
var client_secret = 'YourSecretIDGoesHere'; // Your secret
var redirect_uri = 'http://localhost:8888/callback'; // Your redirect uri
var redirect_uri = 'https://127.0.0.1:8888/callback'; // Your redirect uri


const generateRandomString = (length) => {
Expand Down
4 changes: 2 additions & 2 deletions authorization/authorization_code_pkce/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ to grant permissions to the app.

You will need to register your app and get your own credentials from the [Spotify for Developers Dashboard](https://developer.spotify.com/dashboard).

- Create a new app in the dashboard and add `http://localhost:8080` to the app's redirect URL list.
- Create a new app in the dashboard and add `https://127.0.0.1:8080` to the app's redirect URL list.
- Once you have created your app, update the `client_id` and `redirect_uri` in the `public/app.js` file with the values obtained from the app settings in the dashboard.

## Running the example
Expand All @@ -16,4 +16,4 @@ From a console shell:

$ npm start

Then, open `http://localhost:8080` in a browser.
Then, open `https://127.0.0.1:8080` in a browser.
2 changes: 1 addition & 1 deletion authorization/authorization_code_pkce/public/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*/

const clientId = 'yourClientIDGoesHere'; // your clientId
const redirectUrl = 'eg:http://localhost:8080'; // your redirect URL - must be localhost URL and/or HTTPS
const redirectUrl = 'eg:https://127.0.0.1:8080'; // your redirect URL - must be localhost URL and/or HTTPS

const authorizationEndpoint = "https://accounts.spotify.com/authorize";
const tokenEndpoint = "https://accounts.spotify.com/api/token";
Expand Down
2 changes: 1 addition & 1 deletion authorization/client_credentials/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ This example runs on Node.js. On [its website](http://www.nodejs.org/download/)

You will need to register your app and get your own credentials from the [Spotify for Developers Dashboard](https://developer.spotify.com/dashboard).

- Create a new app in the dashboard and add `http://localhost:8888/callback` to the app's redirect URL list.
- Create a new app in the dashboard and add `https://127.0.0.1:8888/callback` to the app's redirect URL list.
- Once you have created your app, update the `client_id` and `client_secret` in the `app.js` file with the credentials obtained from the app settings in the dashboard.

## Running the example
Expand Down
4 changes: 2 additions & 2 deletions authorization/implicit_grant/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Install the app dependencies running:

You will need to register your app and get your own credentials from the [Spotify for Developers Dashboard](https://developer.spotify.com/dashboard).

- Create a new app in the dashboard and add `http://localhost:8080` to the app's redirect URL list.
- Create a new app in the dashboard and add `https://127.0.0.1:8080` to the app's redirect URL list.
- Once you have created your app, update the `client_id` and `redirect_uri` in the `public/index.html` file with the values obtained from the app settings in the dashboard.

## Running the example
Expand All @@ -26,4 +26,4 @@ From a console shell:

$ npm start

Then, open `http://localhost:8080` in a browser.
Then, open `https://127.0.0.1:8080` in a browser.
2 changes: 1 addition & 1 deletion get_user_profile/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ To run this demo you will need:

## Usage

Create an app in your [Spotify Developer Dashboard](https://developer.spotify.com/dashboard/), set the redirect URI to ` http://localhost:5173/callback` and `http://localhost:5173/callback/` and copy your Client ID.
Create an app in your [Spotify Developer Dashboard](https://developer.spotify.com/dashboard/), set the redirect URI to ` https://127.0.0.1:5173/callback` and `https://127.0.0.1:5173/callback/` and copy your Client ID.

Clone the repository, ensure that you are in the `get_user_profile` directory and run:

Expand Down
4 changes: 2 additions & 2 deletions get_user_profile/src/authCodeWithPkce.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export async function redirectToAuthCodeFlow(clientId: string) {
const params = new URLSearchParams();
params.append("client_id", clientId);
params.append("response_type", "code");
params.append("redirect_uri", "http://localhost:5173/callback");
params.append("redirect_uri", "https://127.0.0.1:5173/callback");
params.append("scope", "user-read-private user-read-email");
params.append("code_challenge_method", "S256");
params.append("code_challenge", challenge);
Expand All @@ -22,7 +22,7 @@ export async function getAccessToken(clientId: string, code: string) {
params.append("client_id", clientId);
params.append("grant_type", "authorization_code");
params.append("code", code);
params.append("redirect_uri", "http://localhost:5173/callback");
params.append("redirect_uri", "https://127.0.0.1:5173/callback");
params.append("code_verifier", verifier!);

const result = await fetch("https://accounts.spotify.com/api/token", {
Expand Down