What are OpenID Connect and OAuth 2.0?
OpenID Connect is a standard that enables you to authenticate users and obtain their identity information (such as name, email, profile picture, etc.) from an identity provider, such as Yahoo. OAuth 2.0 is a standard that enables you to authorize users and obtain their access tokens for accessing protected resources (such as email, contacts, calendar, etc.) from a resource server, such as Yahoo.
Both protocols use a similar flow, where the user is redirected to the identity provider or resource server to grant consent, and then the application receives a code that can be exchanged for a token. The token can then be used to access the user's data or perform actions on their behalf.
How to create an application on Yahoo Developer Network?
To use Yahoo Token Creator, you need to have a Yahoo account and create an application on Yahoo Developer Network (YDN). This will provide you with a Client ID (Consumer Key) and Client Secret (Consumer Secret) that are required for the token requests. You also need to specify a callback domain, which is where Yahoo will send the responses to your requests. Additionally, you need to request permissions for the Yahoo APIs that you want to access with your tokens.
To create an application on YDN, follow these steps:
Log into [dev.flurry.com] with your Yahoo account.
Select the Admin (wrench icon) from the Left navigation bar.
Select Users.
Click on "+ Programmatic User".
Login with your Flurry account credentials (email address / password). You have to be the (Flurry) administrator of the company you are looking to generate the token for.
Create Programmatic User: The system suggests a programmatic account name that would be tied with the programmatic token for your company. You can accept the suggested account name (or provide another unique one) to create the programmatic user.
Click Create Account to proceed.
Receive the token code to access the API. Save the token, although you can refresh the token, there is no interface available to recall current token. (Keep this token secure. This token cannot be retrieved from Flurry systems.)
Click on the Next button to declare the role for the programmatic user. By default all features (Except GDPR Data Access Rights API) are enabled for programmatic API access using this token. Make changes, if needed.
Save.
You can always go to [My Apps] to view your applications and OAuth credentials.
How to use Yahoo Token Creator?
Yahoo Token Creator is a tool that allows you to generate and manage tokens for accessing Yahoo APIs and services using OpenID Connect and OAuth 2.0 protocols. You can use it to acquire an authorization code, exchange it for an ID Token (OpenID), an Access Token (OAuth), and a Refresh Token (OAuth), and refresh your tokens when they expire.
To use Yahoo Token Creator, follow these steps:
Go to [hapteolagil/yahoo-token-creator] on Docker Hub.
Pull the image using the command: docker pull hapteolagil/yahoo-token-creator
Run the image using the command: docker run -it hapteolagil/yahoo-token-creator
Enter your Client ID (Consumer Key) and Client Secret (Consumer Secret) that you obtained from YDN.
Enter your callback domain that you specified on YDN.
Select the scope identifiers that correspond to the Yahoo APIs that you want to access. For example, to get an ID Token to authenticate a user, you are required to specify the scope identifier openid.
Send an authentication request to Yahoo using the command: auth
Copy the URL that is displayed and paste it in your browser.
Log in with your Yahoo account and grant consent to the application.
Copy the code that is displayed or appended to the callback URL and paste it in the terminal.
Exchange the code for an ID Token, an Access Token, and a Refresh Token using the command: token
Copy and save the tokens that are displayed. You can use them to access the Yahoo APIs and services that you requested.
Refresh your tokens when they expire using the command: refresh
You can also use the command: help to see the available commands and their descriptions.
Conclusion
In this article, we have explained what OpenID Connect and OAuth 2.0 are, how to create an application on Yahoo Developer Network, and how to use Yahoo Token Creator to generate and manage tokens for accessing Yahoo APIs and services. We hope that this guide will help you to use Yahoo Token Creator effectively and securely.
References:
[Acquire the API access token - Yahoo Developer Network]
[Getting Started - Yahoo Developer Network]
[hapteolagil/yahoo-token-creator - Docker]
[Generate and manage third-party app passwords - Yahoo]
a104e7fe7e