コード例 #1
0
    /// <summary>Constructs a new flow using the initializer's properties.</summary>
    public AuthorizationCodeFlow(OAuth2Context initializer)
    {
      _ = initializer;

      if (_.ClientSecrets == null || _.DataStore == null)
      {
        throw new ArgumentException("You MUST set ClientSecret and DataStore on the initializer");
      }
    }
コード例 #2
0
ファイル: Program.cs プロジェクト: heartszhang/famous
 static void Main(string[] args)
 {
     var ctx = new OAuth2Context(AzureConsts.AuthorizationServerUrl, AzureConsts.TokenServerUrl,
     AzureConsts.RedirectUrl)
       {
     ClientSecrets = AzureSecrets,
     DataStore = new FileDataStore("oauthdemo"),
     //        Scopes = new[] { "https://api.datamarket.azure.com/" },// sohu require basic scope
       };
       var broker = new WebAuthorizationBroker(ctx);
       var resp = broker.AuthorizeAsync("default", true, CancellationToken.None).Result;
 }
コード例 #3
0
 public WebAuthorizationBroker(OAuth2Context c)
 {
   flow = new AuthorizationCodeFlow(c);
 }