Auth0 Home Blog Docs

How to retrieve access_token using google connection?

I am a backend developer and I need to retrieve an access token for my backend to test how it works.

I successfully configured google-oauth2 connection (“Try” button works well).
I’ve found the route for retrieving token: /oauth/token, but I need to obtain a valid code for it.

How can I do that? I found some route to do that but it won’t work for me:

I see "Oops!, something went wrong" error while going through it.

I’ve tried to create a simple HTML page with code example from docs:

// Script uses auth0.js. See Remarks for details.
<script src=""></script>
<script type="text/javascript">
  // Initialize app
  var webAuth = new auth0.WebAuth({
    domain:       'myapp',
    clientID:     'p2...',
	responseType: "code"

  // Trigger login with google
    connection: 'google-oauth2'


And I still have the same error:
enter image description here

Could somebody help me?

Solved. I just figured out that I can check Logs on auth0 side.

1 Like

Glad you made it! Feel free to ask any other questions down the road!

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.