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

OAuth 2.0 Authentication (basic) #160

Merged
merged 5 commits into from
Mar 22, 2023
Merged

OAuth 2.0 Authentication (basic) #160

merged 5 commits into from
Mar 22, 2023

Conversation

sitingren
Copy link
Member

@sitingren sitingren commented Mar 22, 2023

(#156) The client can accept an OAuth Access Token for authentication.

// Example: Authenticate with OAuth. In order for this to work, one should complete the OAuth flow
// to get an access token, which is beyond (for now!) the scope of this PR.
package main

import (
	"database/sql"
	"fmt"
	"net/url"
	"os"

	_ "github.com/vertica/vertica-sql-go"
)

func main() {
        token := os.Getenv("VERTICA_OAUTH_TOKEN")
        escapedToken := url.QueryEscape(token)
        myDBConnectString := fmt.Sprintf("vertica://@localhost:5433/DBname?oauth_access_token=%v", escapedToken)
        connDB, err := sql.Open("vertica", myDBConnectString)
        ......
}

@sitingren sitingren changed the title OAuth 2.0 Authentication OAuth 2.0 Authentication (basic) Mar 22, 2023
@sitingren sitingren merged commit 75fc59d into vertica:master Mar 22, 2023
@sitingren sitingren deleted the oauth1 branch March 22, 2023 13:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant