diff --git a/authorization/authorization_code/README.md b/authorization/authorization_code/README.md index 00f21d79..8000a3ca 100644 --- a/authorization/authorization_code/README.md +++ b/authorization/authorization_code/README.md @@ -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 @@ -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. diff --git a/authorization/authorization_code/app.js b/authorization/authorization_code/app.js index ebd40d1f..a08a2c34 100644 --- a/authorization/authorization_code/app.js +++ b/authorization/authorization_code/app.js @@ -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) => { diff --git a/authorization/authorization_code_pkce/README.md b/authorization/authorization_code_pkce/README.md index 744ce7ee..8f95b4a1 100644 --- a/authorization/authorization_code_pkce/README.md +++ b/authorization/authorization_code_pkce/README.md @@ -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 @@ -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. diff --git a/authorization/authorization_code_pkce/public/app.js b/authorization/authorization_code_pkce/public/app.js index ca3318f7..ecb3e083 100644 --- a/authorization/authorization_code_pkce/public/app.js +++ b/authorization/authorization_code_pkce/public/app.js @@ -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"; diff --git a/authorization/client_credentials/README.md b/authorization/client_credentials/README.md index 4d43a25c..e79ba0e1 100644 --- a/authorization/client_credentials/README.md +++ b/authorization/client_credentials/README.md @@ -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 diff --git a/authorization/implicit_grant/README.md b/authorization/implicit_grant/README.md index ae706132..7bc5026a 100644 --- a/authorization/implicit_grant/README.md +++ b/authorization/implicit_grant/README.md @@ -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 @@ -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. diff --git a/get_user_profile/README.md b/get_user_profile/README.md index a1183eb7..a06d729b 100644 --- a/get_user_profile/README.md +++ b/get_user_profile/README.md @@ -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: diff --git a/get_user_profile/src/authCodeWithPkce.ts b/get_user_profile/src/authCodeWithPkce.ts index 52381f77..3ce260df 100644 --- a/get_user_profile/src/authCodeWithPkce.ts +++ b/get_user_profile/src/authCodeWithPkce.ts @@ -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); @@ -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", {