Authentication_MissingOrMalformed error using graph API example
See original GitHub issueHi,
I’m trying to authenticate a user (with username + password) from a CLI and return the user object from the graph API. I keep getting Authentication_MissingOrMalformed errors.
To simplify the situation, I’ve tried using the example on https://github.com/Azure/azure-sdk-for-node/tree/master/lib/services/graphManagement, using interactive login, but got the same result.
Is there any additional setup I need to do in Azure AD?
I’m also a little confused about the differences between a subscription-id and tenant-id. I used what I believe is the tenant-id from the Azure AD URL. https://manage.windowsazure.com/example.com#Workspaces/ActiveDirectoryExtension/Directory/<<THIS BIT>>/users
(PS. The example contains a minor typo: msrestAzure in the first line should be msRestAzure).
Output below…
Attila:aad-openid-testing jwa$ node test.js To sign in, use a web browser to open the page https://aka.ms/devicelogin. Enter the code yyyyyy to authenticate. { [Error: {"odata.error":{"code":"Authentication_MissingOrMalformed","message":{"lang":"en","value":"Access Token missing or malformed."},"values":null}}] statusCode: 401, request: { rawResponse: false, queryString: {}, method: 'POST', headers: { 'x-ms-client-request-id': 'xxxxx-xxxx-xxxx-xxxx-xxxxxxxx', 'accept-language': 'en-US', 'Content-Type': 'application/json; charset=utf-8' }, url: 'https://graph.windows.net/xxxxxxx-xxxx-xxxx-xxxxx-xxxxxx/users?api-version=1.6', body: '{"accountEnabled":true,"displayName":"Jon Snow","passwordProfile":{"password":"WinterisComing!","forceChangePasswordNextLogin":false},"userPrincipalName":"OfficialStark@GOT.com","mailNickname":"OfficialStark"}' }, response: { body: '{"odata.error":{"code":"Authentication_MissingOrMalformed","message":{"lang":"en","value":"Access Token missing or malformed."},"values":null}}', headers: { 'cache-control': 'private', 'content-type': 'application/json;odata=minimalmetadata;charset=utf-8', server: 'Microsoft-IIS/8.5', 'ocp-aad-diagnostics-server-name': 'ExxxxxxxxY=', 'request-id': 'zzzzzz-zzzz-zzzzz-zzzzzz-zzzzzzz', 'client-request-id': 'xxxxx-xxxxx-xxxx-xxxx-xxxxxxxx', 'x-ms-dirapi-data-contract-version': '1.6', 'x-ms-gateway-rewrite': 'false', 'strict-transport-security': 'max-age=31536000; includeSubDomains', 'access-control-allow-origin': '*', 'x-aspnet-version': '4.0.30319', 'x-powered-by': 'ASP.NET, ASP.NET', duration: '2219246', date: 'Thu, 23 Jun 2016 00:22:20 GMT', connection: 'close', 'content-length': '143' }, statusCode: 401 }, body: {} }
Issue Analytics
- State:
- Created 7 years ago
- Comments:7 (3 by maintainers)
Top GitHub Comments
Thanks a lot @amarzavery @jamesabbottsmith !
@jamesabbottsmith - I have updated the doc as per your suggestion https://github.com/Azure/azure-sdk-for-node/blob/master/lib/services/graphManagement/README.md. Thanks 👍