Added more API documentation

This commit is contained in:
David Allen 2024-07-23 16:18:21 -06:00
parent 2bc3c74277
commit f7b08da064
No known key found for this signature in database
GPG key ID: 717C593FF60A2ACC
8 changed files with 150 additions and 90 deletions

View file

@ -8,6 +8,17 @@ import (
"github.com/pkg/browser"
)
// Login() initiates the process to retrieve an access token from an identity provider.
// This function is especially designed to work by OPAAL, but will propably be changed
// in the future to be more agnostic.
//
// The 'targetHost' and 'targetPort' parameters should point to the target host/port
// to create a temporary server to receive the access token. If an empty 'targetHost'
// or an invalid port range is passed, then neither of the parameters will be used
// and no server will be started.
//
// Returns an access token as a string if successful and nil error. Otherwise, returns
// an empty string with an error set.
func Login(loginUrl string, targetHost string, targetPort int) (string, error) {
var accessToken string