Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding missing commas to example #286

Merged
merged 6 commits into from
Oct 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
22 changes: 11 additions & 11 deletions doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,19 @@ Package auth0 provides a client for using the Auth0 Authentication and Managemen
# Usage

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
"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"
)

Initialize a new client using a context, domain, client ID, and client secret if required.

authAPI, err := authentication.New(
context.Background(),
domain,
authentication.WithClientID(id)
authentication.WithClientSecret(secret) // Optional depending on the grants used
authentication.WithClientID(id),
authentication.WithClientSecret(secret), // Optional depending on the grants used
)
if err != nil {
// handle err
Expand Down Expand Up @@ -53,15 +53,15 @@ Now we have an authentication client, we can interact with the Auth0 Authenticat
Usage

import (
github.com/auth0/go-auth0
github.com/auth0/go-auth0/management
"github.com/auth0/go-auth0"
"github.com/auth0/go-auth0/management"
)

Initialize a new client using a domain, client ID and secret.

m, err := management.New(
domain,
management.WithClientCredentials(context.Background(), id, secret)
management.WithClientCredentials(context.Background(), id, secret),
)
if err != nil {
// handle err
Expand Down Expand Up @@ -110,7 +110,7 @@ new client.
m, err := management.New(
domain,
management.WithClientCredentials(context.Background(), id, secret),
management.WithDebug(true)
management.WithDebug(true),
)

## Request Options
Expand All @@ -122,7 +122,7 @@ on a request basis.
context.Background(),
management.Page(2),
management.PerPage(10),
management.IncludeFields("id", "name", "options")
management.IncludeFields("id", "name", "options"),
management.Parameter("strategy", "auth0"),
)
*/
Expand Down
Loading