Skip to content

Commit a9eda21

Browse files
committed
Added docs for a signin button #45
1 parent 6c38c5d commit a9eda21

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

docs/technologies/flask/oauth-google.mdx

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,6 @@ Some changes will be made to the project files to add an authentication mechanis
116116
│ └── templates
117117
├── package.json
118118
├── README.md
119-
├── render.yaml
120119
├── requirements.txt
121120
└── run.py
122121
```
@@ -245,15 +244,30 @@ Now requests to `login/google` route will be handled by this route. From your te
245244
```
246245
From your browser visit [`127.0.0.1:5000/login/google`](http://127.0.0.1:5000/login/google). Once you have logged in, you will be able to access protected resources in your Flask app.
247246

247+
## Adding Signin button to login page
248+
We will be adding a link to the login page to simplify the signin process for the user.
249+
250+
- Add the following code to `apps/templates/accounts/login.html` on line 37
251+
```html
252+
<!--apps/templates/accounts/login.html-->
253+
...
254+
<div class="card-body">
255+
<a href='login/google' class='btn btn-primary'>Sign in with Google</a>
256+
...
257+
```
258+
This adds a link that points to the authorization route. With this, users can signin to the web application using google authentication wihtout having to change the URL from the browser, making for a better user experience.
259+
248260
## Conclusion
249261
In conclusion, this article has provided an overview of OAuth and its importance in modern web applications. We explored the process of creating a Google OAuth Client ID, which is essential for enabling user authentication and authorization using Google accounts. Additionally, we discussed the steps involved in setting up a Flask application, a popular Python web framework, to handle OAuth authentication.
250262

251263
To facilitate OAuth functionality in our Flask application, we installed and configured Flask-Dance, a Flask extension that simplifies the integration of OAuth providers. Specifically, we focused on configuring Flask-Dance with Google OAuth, allowing users to authenticate with their Google accounts in our application.
252264

265+
By adding the "Sign in with Google" button to your login page, you provide users with a convenient and secure method to access your Flask application using their Google accounts. This not only simplifies the login process but also enhances the user experience and increases user engagement.
266+
253267
By following the steps outlined in this article, developers can leverage the power of OAuth and Google OAuth specifically to enable secure user authentication and authorization in their Flask applications. This process not only enhances the user experience but also provides a seamless integration with widely used social media and identity platforms.
254268

255269
## Resources
256-
- 👉 [Flask-Dance] Documentation(https://flask-dance.readthedocs.io/en/latest/)
270+
- 👉 [Flask-Dance](https://flask-dance.readthedocs.io/en/latest/) Documentation
257271
- 👉 [Google Cloud Platform](https://console.cloud.google.com/) - the official website
258272
- 👉 Free [Support](https://appseed.us/support/) via Email & Discord
259273
- 👉 [Custom Development Services](https://appseed.us/custom-development/) provided by experts

0 commit comments

Comments
 (0)