hi,
I am trying to use Azure Active Directory to authenticate a user within a console app.
I've performed the following steps:
1. Went to the Azure Active Directory preview portal and created a new tenant.
2. Verified that the endpoint with the tenat excists.
3. Used Powershell to create a new service principal within the tenant:
DisplayName : Central
ServicePrincipalNames : {Central/localhost, -57f8-4dab-b967-492
91f3a750e}
ObjectId : 387a9042-7ad5--4967d23786c1
AppPrincipalId : 6638c788-57f8--49291f3a7501
TrustedForDelegation : False
AccountEnabled : True
Addresses : {}
KeyType : Symmetric
KeyId :
StartDate : 10/1/2012 7:00:00 AM
EndDate : 10/1/2015 7:00:00 AM
Usage : Verify
Created a new console app
4. Added the azure authentication library
5. Tried the following lines of code
var _authContext = new AuthenticationContext("https://accounts.accesscontrol.windows.net/p???.onmicrosoft.com"); UsernamePasswordCredential c = new UsernamePasswordCredential("p??.onmicrosoft.com", "1", "2"); AssertionCredential z = _authContext.AcquireToken("urn:NonInteractiveAuthentication" ,c);
And I get the error AAL 0x80100005: Unable to obtain credential
Anybody any suggestions ?