8 "git.sr.ht/~emersion/go-scfg"
9 "github.com/AzureAD/microsoft-authentication-library-for-go/apps/confidential"
12 var config_with_pointers
struct {
14 Port
*int `scfg:"port"`
15 Bind
*string `scfg:"bind"`
18 Client
*string `scfg:"client"`
19 Tenant
*string `scfg:"tenant"`
20 Secret
*string `scfg:"secret"`
21 Callback
*string `scfg:"callback"`
39 f
, err
:= os
.Open("fbfp.scfg")
42 err
= scfg
.NewDecoder(bufio
.NewReader(f
)).Decode(&config_with_pointers
)
45 config
.Listen
.Port
= *(config_with_pointers
.Listen
.Port
)
46 config
.Listen
.Bind
= *(config_with_pointers
.Listen
.Bind
)
47 config
.Msal
.Client
= *(config_with_pointers
.Msal
.Client
)
48 config
.Msal
.Tenant
= *(config_with_pointers
.Msal
.Tenant
)
49 config
.Msal
.Secret
= *(config_with_pointers
.Msal
.Secret
)
50 config
.Msal
.Callback
= *(config_with_pointers
.Msal
.Callback
)
52 cred
, err
:= confidential
.NewCredFromSecret(config
.Msal
.Secret
)