Skip to content

Commit

Permalink
Fix code snippets in README
Browse files Browse the repository at this point in the history
  • Loading branch information
ewanharris committed Oct 9, 2023
1 parent afe69f4 commit f0880dd
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,18 @@ The Authentication API client is based on the [Authentication API docs](https://
Create an Authentication API client by providing the details of your Auth0 Application.

```go
package main

import (
github.com/auth0/go-auth0
github.com/auth0/go-auth0/authentication
github.com/auth0/go-auth0/authentication/database
github.com/auth0/go-auth0/authentication/oauth
"context"
"log"

"github.com/auth0/go-auth0/authentication"
"github.com/auth0/go-auth0/authentication/database"
"github.com/auth0/go-auth0/authentication/oauth"
)

func main () {
func main() {
// Get these from your Auth0 Application Dashboard.
domain := "example.us.auth0.com"
clientID := "EXAMPLE_16L9d34h0qe4NVE6SaHxZEid"
Expand All @@ -64,8 +68,8 @@ func main () {
authAPI, err := authentication.New(
context.Background(),
domain,
authentication.WithClientID(clientID)
authentication.WithClientSecret(clientSecret) // Optional depending on the grants used
authentication.WithClientID(clientID),
authentication.WithClientSecret(clientSecret), // Optional depending on the grants used
)
if err != nil {
log.Fatalf("failed to initialize the auth0 authentication API client: %+v", err)
Expand All @@ -89,7 +93,7 @@ func main () {
tokenSet, err := authAPI.OAuth.LoginWithAuthCodeWithPKCE(context.Background(), oauth.LoginWithAuthCodeWithPKCERequest{
Code: "test-code",
CodeVerifier: "test-code-verifier",
}, oauth.IDTokenValidationOptionalVerification{})
}, oauth.IDTokenValidationOptions{})
if err != nil {
log.Fatalf("failed to retrieve tokens: %+v", err)
}
Expand Down

0 comments on commit f0880dd

Please sign in to comment.