Skip to content

Commit d2c5338

Browse files
Update README.md
1 parent 4e8ae88 commit d2c5338

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

README.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,48 @@ Django poll app is a full featured polling app. You have to register in this app
2929
<code>seeder.seed_all(30)</code>
3030
<p>Here 30 is a number of entry. You can use it as your own</p>
3131

32+
<h2>Obtaining OAuth Client ID for Google:</h2>
33+
34+
To use Google's OAuth authentication in your application, you need to obtain a client ID and client secret. Follow these steps to get your OAuth client ID for Google:
35+
36+
1. **Go to the Google Cloud Console:**
37+
- Navigate to [Google Cloud Console](https://console.cloud.google.com/).
38+
- Sign in with your Google account.
39+
40+
2. **Create a new project:**
41+
- Click on the project dropdown menu at the top of the page.
42+
- Click on "New Project" and follow the prompts to create a new project.
43+
44+
3. **Enable the Google Identity service:**
45+
- In the Google Cloud Console, navigate to "APIs & Services" > "Dashboard."
46+
- Click on "Enable APIs and Services."
47+
- Search for "Google Identity" or "Google+ API" and enable it for your project.
48+
49+
4. **Create OAuth consent screen:**
50+
- In the Google Cloud Console, navigate to "APIs & Services" > "OAuth consent screen."
51+
- Fill in the required fields (like application name, user support email, etc.).
52+
- Add scopes (permissions) your application requires.
53+
- Save the consent screen information.
54+
55+
5. **Create OAuth credentials:**
56+
- In the Google Cloud Console, navigate to "APIs & Services" > "Credentials."
57+
- Click on "Create Credentials" > "OAuth client ID."
58+
- Select "Web application" as the application type.
59+
- Enter a name for your OAuth client.
60+
- Add authorized redirect URIs : `http://127.0.0.1:8000/complete/google-oauth2/`
61+
- Click "Create."
62+
63+
6. **Copy the client ID and client secret:**
64+
- Once the OAuth client is created, you'll see your client ID and client secret.
65+
- Copy these values and update following variables in settings.py
66+
67+
<code>
68+
SOCIAL_AUTH_GOOGLE_OAUTH2_KEY = 'your-client-id'
69+
SOCIAL_AUTH_GOOGLE_OAUTH2_SECRET ='your-client-secret'
70+
</code>
71+
72+
For detailed instructions, refer to Google's documentation on [OAuth 2.0](https://developers.google.com/identity/protocols/oauth2).
73+
3274
<h2> To run the program in local server use the following command </h2>
3375
<code>python manage.py runserver</code>
3476

0 commit comments

Comments
 (0)