It is possible or not For this we have to implement OAuth 2.0 flow on the basis of which we will get a token and then on the basis of this token we generate the app password using the Gmail API endpoint.
Loading
It is possible or not For this we have to implement OAuth 2.0 flow on the basis of which we will get a token and then on the basis of this token we generate the app password using the Gmail API endpoint.
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Jithu ThomasPosted Apr 12, 2024, 8:34 AM
No, it's not possible to generate an app password directly using the Gmail API and OAuth 2.0 flow. Here's why:
* **Design**: App passwords are designed as a user-controlled security mechanism for less secure applications that don't support OAuth. Granting access through the API would defeat the purpose of user control.
* **Security**: App passwords are 16-character, single-use credentials. OAuth provides a more secure method with tokens that can be scoped and revoked.
**Recommended Approach:**
For secure access to Gmail functionalities through your application, use OAuth 2.0. This method offers several advantages:
* **Security:** OAuth provides tokens with specific scopes, limiting application access to only the authorized data. Additionally, tokens can be revoked if needed.
* **Granular Control:** You can define the level of access granted to your application through scopes.
* **User Consent:** Users explicitly grant access to your application through the OAuth
Sourabh DhimanPosted Apr 12, 2024, 8:50 AM
Thanks Jithu Thomas.