4
使用ADAL庫獲取WAAD令牌我想知道如何獲得對登錄流程的更多控制。如何控制ADAL AuthenticationContext中的登錄流?
var ac = new AuthenticationContext("https://login.windows.net/" + ActiveDirectoryTenantId);
AuthenticationInfo = ac.AcquireToken(
resource: "https://management.core.windows.net/",
clientId: "1950a258-227b-4e31-a9cf-717495945fc2",
redirectUri: new Uri("urn:ietf:wg:oauth:2.0:oob"));
提示用戶登錄。對於我來說,它是通過Live ID進行的,因爲我的客戶的計算機是通過組織帳戶進行的,無法在它們之間切換。它似乎受到計算機可能運行的當前會話的方式/已經登錄到天藍色的控制。
我可以在AcquireToken調用中做任何事情來控制它嗎? 如果我可以在人們登錄到Azure時觸發正常流程,那麼他們最好選擇是否存在活動ID或組織登錄。
我已經試過這樣:
ac.AcquireToken("https://management.core.windows.net/",
"1950a258-227b-4e31-a9cf-717495945fc2",
new Uri("urn:ietf:wg:oauth:2.0:oob"), PromptBehavior.Always,"wtrealm=urn:federation:MicrosoftOnline");
沒有運氣。
這需要嵌入到ADAL方法中......本地客戶端有時需要更改登錄的用戶而無需重新啓動! –