File: main.go

package info (click to toggle)
golang-github-azuread-microsoft-authentication-library-for-go 1.0.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 964 kB
  • sloc: makefile: 4
file content (33 lines) | stat: -rw-r--r-- 755 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package main

import (
	"context"
	"os"
)

var (
	//config        = CreateConfig("config.json")
	cacheAccessor = &TokenCache{file: "serialized_cache.json"}
)

func main() {
	ctx := context.Background()

	// TODO(msal): This is pretty yikes. At least we should use the flag package.
	exampleType := os.Args[1]
	if exampleType == "1" {
		acquireTokenDeviceCode()
		/*} else if exampleType == "2" {
		acquireByAuthorizationCodePublic()
		*/
	} else if exampleType == "3" {
		acquireByUsernamePasswordPublic(ctx)
	} else if exampleType == "4" {
		panic("currently not implemented")
		//acquireByAuthorizationCodeConfidential()
	} else if exampleType == "5" {
		acquireTokenClientSecret()
	} else if exampleType == "6" {
		acquireTokenClientCertificate()
	}
}