Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Authentication_MissingOrMalformed error using graph API example

See original GitHub issue


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, 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.<<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 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: '', body: '{"accountEnabled":true,"displayName":"Jon Snow","passwordProfile":{"password":"WinterisComing!","forceChangePasswordNextLogin":false},"userPrincipalName":"","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:closed
  • Created 7 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

arafatocommented, Jul 8, 2016
amarzaverycommented, Jul 8, 2016
Read more comments on GitHub >

github_iconTop Results From Across the Web

Microsoft Graph API Authentication_MissingOrMalformed
I got this issue while performing the CRUD operation on Azure AD B2C service via AD Graph API for user management.
Read more >
"Access Token missing or malformed" when doing "addKey" to ...
I am trying to add a new certificate to an App Registration via Graph API. The steps detailed in this article basically.
Read more >
My bearer token is not valid when calling the Active directory API
When using Microsoft Graph endpoint I get the same error. ... I have a service principal, I use your example and get a...
Read more >
connect-AzureAD works (it seems) but Get-Azureaduser gives ...
Now I wanted to use retrieve som data from Azure ad. ... DESCRIPTION # Gets a Microsoft Graph API Access Token equivalent with...
Read more >
Handle Errors - Graph API - Meta for Developers
Error Responses. The following represents a common error response resulting from a failed API request: { "error": ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found