Skip to content

donaldevine/OAuthRestClient

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OAuth REST Client

License NuGet Status

This is simple, light package created using Microsoft Authentication Library (MSAL) to access REST API using OAuth2 and OpenID Connect authentication.

Get Started

using MsalRestClient;
using System;
using System.Collections.Generic;

namespace MsalRestClientTest
{
    class Program
    {
        static void Main(string[] args)
        {
            var configProvider = new ConfigProvider();
            var restClient = new RestClient(configProvider, null);
            Console.WriteLine(restClient.GetAsync().Result);
            Console.ReadLine();
        }
    }
    
    class ConfigProvider : IConfigProvider
    {
        string GetAuthority() => "https://login.microsoftonline.com/<tenantID>";
        Uri GetBaseUri() => "";
        string GetClientID() => "";
        string GetClientSecret() => ""; // Applicable for app only mode
        string GetRedirectUri() => "";
        IEnumerable<string> GetScopes() => new[] { "email" }
    }
}

API Documentation

This C# library provide a thin REST Client using OAuth authentication.

About

This is simple, light package created using Microsoft Authentication Library (MSAL) to access REST API using OAuth2 and OpenID Connect authentication.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 100.0%