When using GitHub codespaces, how to setup Google Oauth for development

When using GitHub codespaces, how to setup Google OAuth for development/
6 Replies
kapa.ai
kapa.ai4mo ago
Hi @2b|¬2b. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- To set up Google OAuth for development in Wasp, you'll need to create a Google OAuth App and provide Wasp with your client key and secret. Here's how you do it: 1. Create a Google Cloud Platform account if you do not already have one: Google Cloud Platform (https://cloud.google.com/) 2. Create and configure a new Google project here: Google Cloud Console (https://console.cloud.google.com/home/dashboard) 3. Search for OAuth in the top bar, click on OAuth consent screen. - Select what type of app you want, we will go with External. - Fill out applicable information on Page 1. - On Page 2, Scopes, you should select userinfo.profile. You can optionally search for other things, like email. - Add any test users you want on Page 3. 4. Next, click Credentials. - Select Create Credentials. - Select OAuth client ID. - Complete the form - Under Authorized redirect URIs, put in: <http://localhost:3001/auth/google/callback> - Once you know on which URL(s) your API server will be deployed, also add those URL(s). - For example: <https://your-server-url.com/auth/google/callback> - When you save, you can click the Edit icon and your credentials will be shown. 5. Copy your Client ID and Client secret as you will need them in the next step. After you have your Client ID and Client secret, add these environment variables to the .env.server file at the root of your project:
GOOGLE_CLIENT_ID=your-google-client-id
GOOGLE_CLIENT_SECRET=your-google-client-secret
GOOGLE_CLIENT_ID=your-google-client-id
GOOGLE_CLIENT_SECRET=your-google-client-secret
Please note that the URLs used for the Authorized redirect URIs should match the URLs where your application is running. If you're using GitHub Codespaces, you'll need to adjust these URLs to match the URL of your Codespace. For more detailed instructions, you can refer to the Wasp documentation (https://wasp-lang.dev/docs/auth/social-auth/google#3-creating-a-google-oauth-app). ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ---------------------- Sorry @2b|¬2b, I seem to be having a bit of trouble. Don't worry though, I've pinged my support and they will try to fix me up! :technologist: Perhaps try again in 15mins?
2b|¬2b
2b|¬2b4mo ago
I guess this is something to do with GitHub CodeSpaces portforwarding
martinsos
martinsos4mo ago
@2b|¬2b did you manage to get Wasp working in GitHub CodeSpaces? And now you are trying to get Google OAuth working? What have you tried / what is not working? You are probably on right track that this has sometihng to do with ports. And, callback URL from Google for sure. @Vinny (@Wasp) might be able to help here also, he was just looking into Codespaces a couple days ago.
Vinny (@Wasp)
Vinny (@Wasp)4mo ago
try changing the ports to public also, make sure to add WASP_WEB_CLIENT_URL to your .env.server file and REACT_APP_API_URL to .env.client with the URLs from the port forwarding tab
Vinny (@Wasp)
Vinny (@Wasp)4mo ago
No description
Vinny (@Wasp)
Vinny (@Wasp)4mo ago
No description
Want results from more Discord servers?
Add your server
More Posts