func GetGraphAuthorizer() (autorest.Authorizer, error) {
	if graphAuthorizer != nil {
		return graphAuthorizer, nil
	}
	var a autorest.Authorizer
	var err error
	a, err = getAuthorizerForResource(grantType(), config.Environment().GraphEndpoint)
	if err == nil {
		graphAuthorizer = a
	} else {
		graphAuthorizer = nil
	}
	return graphAuthorizer, err
}
GetGraphAuthorizer gets an OAuthTokenAuthorizer for graphrbac API.
package iam
import (
	"fmt"
	"net/url"
	"strings"
	"github.com/Azure-Samples/azure-sdk-for-go-samples/internal/config"
	"github.com/Azure/go-autorest/autorest"
	"github.com/Azure/go-autorest/autorest/adal"
	"github.com/Azure/go-autorest/autorest/azure/auth"
)
var (
	armAuthorizer      autorest.Authorizer
	batchAuthorizer    autorest.Authorizer
	graphAuthorizer    autorest.Authorizer
	keyvaultAuthorizer autorest.Authorizer
)
type OAuthGrantType int
const (
	OAuthGrantTypeServicePrincipal OAuthGrantType = iota
	OAuthGrantTypeDeviceFlow
)
func grantType() OAuthGrantType {
	if config.UseDeviceFlow() {
		return OAuthGrantTypeDeviceFlow
	}
	return OAuthGrantTypeServicePrincipal
}
func GetResourceManagementAuthorizer() (autorest.Authorizer, error) {
	if armAuthorizer != nil {
		return armAuthorizer, nil
	}
	var a autorest.Authorizer
	var err error
	a, err = getAuthorizerForResource(
		grantType(), config.Environment().ResourceManagerEndpoint)
	if err == nil {
		armAuthorizer = a
	} else {
		armAuthorizer = nil
	}
	return armAuthorizer, err
}
func GetBatchAuthorizer() (autorest.Authorizer, error) {
	if batchAuthorizer != nil {
		return batchAuthorizer, nil
	}
	var a autorest.Authorizer
	var err error
	a, err = getAuthorizerForResource(
		grantType(), config.Environment().BatchManagementEndpoint)
	if err == nil {
		batchAuthorizer = a
	} else {
		batchAuthorizer = nil
	}
	return batchAuthorizer, err
}