Created
February 12, 2015 10:05
-
-
Save wictorwilen/866aef50f9996934d08a to your computer and use it in GitHub Desktop.
Azure AD AuthN stuff
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
string resourceId = "<resource id>"; | |
// Can be: | |
// For SharePoint (CSOM), tenant Url: https://tenant.sharepoint.com | |
// For Azure AD Graph: https://graph.windows.net | |
// For Office 365 Discovery: https://api.office.com/discovery/ | |
// For Exchange Online: https://outlook.office365.com/ | |
string secret = "<App client secret>"; // a generated guid | |
Uri redirectUri = new Uri("<App redirect Uri>"); // for instance app://my-app | |
AuthenticationContext context = new AuthenticationContext("https://login.windows.net/common"); | |
AuthenticationResult result = context.AcquireToken(resourceId, secret, redirectUri); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment