package
1.7.0-preview20241215
Repository: https://github.com/recolabs/servicenow-sdk-go.git
Documentation: pkg.go.dev

# README

Credentials

The credential module exists to provide various was to authenticate to the ServiceNow APIs.

Username and Password Credential

UsernamePasswordCredential is a Basic Credential type, where the SDK authenticates via the provided username and password.

NOTE: the supplied credentials are stored within the credential and the fields are exported.

import (
    "github.com/RecoLabs/servicenow-sdk-go/credentials"
)

func main() {
    cred, err := credentials.NewUsernamePasswordCredential("username", "password")
    if err != nil {
        panic(err)
    }

    ...
}

Token Credential

TokenCredential is a Token Credential type, where the SDK authenticates via a token retrieved using the provided username and password.

import (
    "github.com/RecoLabs/servicenow-sdk-go/credentials"
)

func main() {
    cred, err := credentials.NewTokenCredential("clientID", "clientSecret", "baseURL", prompt)
    if err != nil {
        panic(err)
    }

    ...
}