Using the Azure Go SDK for EntraID (azure-sdk-for-go
), please explain how to have a custom web server, and callback for when the signup succeeds in order to serve a custom web page. The reason for this is to have a more visually appealing web page. The primary use of this will be for “desktop” applications, making use of the graph-api.
I have this code, and I am unable to make use of a custom web server…
// creates a server, and when the path callback is called,
// it serves a custom web page.
port, err := webserver.StartServer()
if err != nil {
log.Fatalf("Fatal error starting server: %vn", err)
}
callbackURL := fmt.Sprintf("http://localhost:%d/callback", port)
// callbackURL := "https://localhost/callback"
cred, _ := azidentity.NewInteractiveBrowserCredential(&azidentity.InteractiveBrowserCredentialOptions{
TenantID: "common",
ClientID: clientID,
RedirectURL: callbackURL,
})
This code produces the following error:
error InteractiveBrowserCredential: listen tcp 127.0.0.1:60628: bind: address already in use
panic: runtime error: invalid memory address or nil pointer dereference