Mar 27, 2024 Replies: 1 Hi Fam Step 1 1. Create client id and client secret. On the Google API, select "Credentials" > Create Credentials > OAuth Client ID Follow these instructions here from the google api console. Setting up OAuth 2.0 - API Console Help This page is no longer up-to-date. For current instructions on how to set up and manage your Google OAuth Client, please see the M support.google.com You will use the Client ID & Client Secret in the PocketBase Admin Screen > Settings > Auth Providers Step 2 OAuth Consent Screen. Update your app settings for the consent screen. I didnt use a logo for my app. For testing purposes, I have used "http://127.0.0.1:8010/api/oauth2-redirect" for the redirect url. My app is running on port 8010. Step 3 In your PocketBase Admin screen, select settings on The Auth Providers Select the Google gear and update the Client ID and Client Secret with the content you got from google and save. In your app call, Code: Copy Dim userData As Map = banano.Await(pb.USER_AUTH_WITH_GOOGLE) This will show a google web prompt to authenticate your app. Have fun! Click to expand...
Hi Fam Step 1 1. Create client id and client secret. On the Google API, select "Credentials" > Create Credentials > OAuth Client ID Follow these instructions here from the google api console. Setting up OAuth 2.0 - API Console Help This page is no longer up-to-date. For current instructions on how to set up and manage your Google OAuth Client, please see the M support.google.com You will use the Client ID & Client Secret in the PocketBase Admin Screen > Settings > Auth Providers Step 2 OAuth Consent Screen. Update your app settings for the consent screen. I didnt use a logo for my app. For testing purposes, I have used "http://127.0.0.1:8010/api/oauth2-redirect" for the redirect url. My app is running on port 8010. Step 3 In your PocketBase Admin screen, select settings on The Auth Providers Select the Google gear and update the Client ID and Client Secret with the content you got from google and save. In your app call, Code: Copy Dim userData As Map = banano.Await(pb.USER_AUTH_WITH_GOOGLE) This will show a google web prompt to authenticate your app. Have fun!
Mashiane Expert Licensed User Longtime User Mar 27, 2024 #2 Example Project: Clicking Google Auth, will activate the google auth prompt and ask one to confirm the account. After which the details on the screen will be updated. PS: Sign Out - will not expire the token before time. Reproduction: 1. Download PocketBase 2. Unzip PocketBase.zip file to C:\sdgoogleauth 3. Create a folder named C:\sdgoogleauth\pb_bublic 4. Unzip the googleauth.zip contents into the root of c:\sdgoogleauth. 5. Double click the run_server_8010.bat file 6. Run your application in B4J and refresh your browser tab Attachments SDAuthWithGoogle.zip SDAuthWithGoogle.zip 36.2 KB · Views: 397 sdgoogleauth.zip sdgoogleauth.zip 718 bytes · Views: 398
Example Project: Clicking Google Auth, will activate the google auth prompt and ask one to confirm the account. After which the details on the screen will be updated. PS: Sign Out - will not expire the token before time. Reproduction: 1. Download PocketBase 2. Unzip PocketBase.zip file to C:\sdgoogleauth 3. Create a folder named C:\sdgoogleauth\pb_bublic 4. Unzip the googleauth.zip contents into the root of c:\sdgoogleauth. 5. Double click the run_server_8010.bat file 6. Run your application in B4J and refresh your browser tab