CSP_Graph.Services.GraphService.AcquireTokenForApplication C# (CSharp) Method

AcquireTokenForApplication() public method

public AcquireTokenForApplication ( ) : Token
return CSP_Graph.Entities.Token
        public Token AcquireTokenForApplication()
        {
            string uri = string.Format("{0}/{1}/oauth2/token", authUrl, tenant_name);
            string contentType = "application/x-www-form-urlencoded";
            string content = string.Format("grant_type=client_credentials&client_id={0}&client_secret={1}&resource={2}", app_id, HttpUtility.UrlEncode(app_key), HttpUtility.UrlEncode(graphApiUrl));

            APIService service = new APIService(uri, contentType);

            return service.Send<Token>(content);
        }