2017-07-04 80 views
-2

我訂閱了azure和一個已開發的應用程序,我試圖使用Azure AD作爲身份驗證機制。Azure AD SingleSignOn錯誤

我在Azure中創建了應用程序,添加了Azure AD作爲身份驗證機制,當我嘗試登錄時出現此錯誤。

AADSTS65005:應用程式需要您的組織 ‘123-32323-323232-3233’未簽約或支持服務 (「http://rts.powerapps.com」)訪問。請聯繫您的 IT管理員查看您的服務訂閱的配置。

這是我的啓動類。

public partial class Startup 
{ 

    private static string clientId = ConfigurationManager.AppSettings["ida:ClientId"]; 
    private static string aadInstance = ConfigurationManager.AppSettings["ida:AADInstance"]; 
    private static string tenant = ConfigurationManager.AppSettings["ida:Tenant"]; 
    private static string postLogoutRedirectUri = ConfigurationManager.AppSettings["ida:PostLogoutRedirectUri"]; 

    string authority = String.Format(CultureInfo.InvariantCulture, aadInstance, tenant); 

    public void ConfigureAuth(IAppBuilder app) 
    { 
     app.SetDefaultSignInAsAuthenticationType(CookieAuthenticationDefaults.AuthenticationType); 

     app.UseCookieAuthentication(new CookieAuthenticationOptions()); 

     app.UseOpenIdConnectAuthentication(
      new OpenIdConnectAuthenticationOptions 
      { 
       ClientId = clientId, 
       Authority = authority, 
       PostLogoutRedirectUri = postLogoutRedirectUri, 
       RedirectUri = postLogoutRedirectUri, 
       Notifications = new OpenIdConnectAuthenticationNotifications 
       { 
        AuthenticationFailed = context => 
        { 
         context.HandleResponse(); 
         context.Response.Redirect("/Error?message=" + context.Exception.Message); 
         return Task.FromResult(0); 
        } 
       } 
      }); 
    } 
} 

任何想法?

編輯1:

從現在看來刪除我得到這個錯誤我的權限刪除某些應用程序之後。

Error Img

編輯2:

固定移除和再次添加權限之後。

+0

謝謝,這是我的第一篇文章。 –

+0

在發佈問題前,您應該參加[導覽]並閱讀[問] –

回答

0

您似乎是在使用Common Data Service開發基於服務(「http://rts.powerapps.com」)的服務。請確保您的組織沒有訂閱該服務(「http://rts.powerapps.com」)。

請注意公共數據服務的先決條件:

  1. 如果您已經爲PowerApps簽署了,你可以去PowerApps並登錄如果您還沒有註冊,你。可以按照這些說明註冊。
  2. 確保您具有對包含公用數據服務數據庫的環境的管理員訪問權限。轉到PowerApps門戶,點擊頁面右上角的齒輪圖標,然後點擊管理中心。如果您無權訪問任何包含數據庫的環境,請按照以下說明創建數據庫。

而且下面是有幫助的文檔,以幫助用戶入門:

Get started with the Common Data Service SDK