René's URL Explorer Experiment


Title: 401 when using ChunkedUploadProvider for large mail attachments · Issue #52 · microsoftgraph/msgraph-sdk-java-auth · GitHub

Open Graph Title: 401 when using ChunkedUploadProvider for large mail attachments · Issue #52 · microsoftgraph/msgraph-sdk-java-auth

X Title: 401 when using ChunkedUploadProvider for large mail attachments · Issue #52 · microsoftgraph/msgraph-sdk-java-auth

Description: Expected behavior ChunkedUploadProvider.upload(...) uploads the specified file and attaches it to the message, per https://docs.microsoft.com/en-us/graph/outlook-large-attachments?tabs=java. Actual behavior 401 : Unauthorized upon reques...

Open Graph Description: Expected behavior ChunkedUploadProvider.upload(...) uploads the specified file and attaches it to the message, per https://docs.microsoft.com/en-us/graph/outlook-large-attachments?tabs=java. Actual...

X Description: Expected behavior ChunkedUploadProvider.upload(...) uploads the specified file and attaches it to the message, per https://docs.microsoft.com/en-us/graph/outlook-large-attachments?tabs=java. Actual...

Opengraph URL: https://github.com/microsoftgraph/msgraph-sdk-java-auth/issues/52

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.112.3


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"401 when using ChunkedUploadProvider for large mail attachments","articleBody":"Expected behavior\nChunkedUploadProvider.upload(...) uploads the specified file and attaches it to the message, per https://docs.microsoft.com/en-us/graph/outlook-large-attachments?tabs=java.\nActual behavior\n401 : Unauthorized upon request.\ncom.microsoft.graph.core.ClientException: Error code: InvalidAudienceForResource\nError message: The audience claim value is invalid for current resource. Audience claim is 'https://graph.microsoft.com/', request url is 'https://outlook.office.com/api/v2.0/Users...'.\nThe issue appears to be the API is including an Authorization header in the request, in contradiction with the documentation.\n\nDo not specify an Authorization request header. The PUT query uses a pre-authenticated URL from the uploadUrl property, that allows access to the https://outlook.office.com domain.\n\nInspection of the authtoken parameter in the upload session's URL shows the correct audience ( \"aud\": \"https://outlook.office.com/api/\"), while the auth bearer token's audience is \"https://graph.microsoft.com\".\nSteps to reproduce the behavior\nUsing an MS Dev account and pregenerated users; microsoft-graph-1.9.0.jar, microsoft-graph-core.1.0.1.jar, microsoft-graph-auth-1.9.0.jar; Java 8.\npublic class LargeAttachmentUploadError implements GraphExampleConstants {\n\n    public static void main(String[] args) throws IOException {\n        String recipient = args[0];\n        String filepath = args[1];\n        Path p = Paths.get(new File(filepath).toURI());\n        \n        UsernamePasswordProvider authProvider = new UsernamePasswordProvider(\n                        clientID,\n                        Arrays.asList(\"https://graph.microsoft.com/.default\"),\n                        username,\n                        password,\n                        NationalCloud.Global,\n                        tenant,\n                        clientSecret);\n\n        IGraphServiceClient graphClient = GraphServiceClient\n                        .builder()\n                        .authenticationProvider(authProvider)\n                        .buildClient();\n\n        graphClient.getLogger().setLoggingLevel(LoggerLevel.DEBUG);   \n        \n        Message message = new Message();\n        message.subject = \"Meet for lunch?\";\n        ItemBody body = new ItemBody();\n        body.contentType = BodyType.TEXT;\n        body.content = \"The new cafeteria is open.\";\n        message.body = body;\n        LinkedList\u003cRecipient> toRecipientsList = new LinkedList\u003cRecipient>();\n        Recipient toRecipients = new Recipient();\n        EmailAddress emailAddress = new EmailAddress();\n        emailAddress.address = recipient; \n        toRecipients.emailAddress = emailAddress;\n        toRecipientsList.add(toRecipients);\n        message.toRecipients = toRecipientsList;\n        message.hasAttachments = true;\n        message = graphClient.me().mailFolders(\"drafts\").messages().buildRequest().post(message);\n        \n        AttachmentItem attachmentItem = new AttachmentItem();\n        attachmentItem.name = p.getFileName().toString(); \n        attachmentItem.isInline = false;\n        attachmentItem.attachmentType = AttachmentType.FILE; \n        attachmentItem.size = Files.size(p);\n\n        UploadSession uploadSession = graphClient.me().messages(message.id).attachments().createUploadSession(attachmentItem).buildRequest().post();\n        try(InputStream inputStream = Files.newInputStream(p)) {\n            ChunkedUploadProvider\u003cAttachmentItem> chunkedUploadProvider = new ChunkedUploadProvider\u003c>(uploadSession, graphClient, inputStream, attachmentItem.size, AttachmentItem.class);\n            \n            IProgressCallback\u003cAttachmentItem> progressCallback = new IProgressCallback\u003cAttachmentItem> () {\n                @Override\n                // Called after each slice of the file is uploaded\n                public void progress(final long current, final long max) {\n                    System.out.println(String.format(\"Uploaded %d bytes of %d total bytes\", current, max));\n                }\n\n                @Override\n                public void success(final AttachmentItem result) {\n                    System.out.println(String.format(\"Uploaded mail attachment with ID: %s\", result.name));\n                }\n\n                @Override\n                public void failure(ClientException ex) {\n                    System.out.println(\"Error uploading mail attachment: \" + ex.getMessage());\n                    throw ex;\n                }\n            };\n\n            chunkedUploadProvider.upload(progressCallback, new int[] {320 * 1024, 1});\n        \n        } catch (Exception e) {\n            e.printStackTrace();\n        }\n    }\n}\n[AB#5829](https://microsoftgraph.visualstudio.com/0985d294-5762-4bc2-a565-161ef349ca3e/_workitems/edit/5829)","author":{"url":"https://github.com/jball-vcra","@type":"Person","name":"jball-vcra"},"datePublished":"2020-08-18T00:47:49Z","url":"https://github.com/microsoftgraph/msgraph-sdk-java-auth/issues/52"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:09aaa118-1c15-fe87-5c9e-6554e687758d
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idBFB0:104CA3:1E40A7:28EC16:6B0511EF
html-safe-nonce93fccb96b19573dda8a3697dadea83175a0fc63f3a15f35207f3e7e9c74038aa
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCRkIwOjEwNENBMzoxRTQwQTc6MjhFQzE2OjZCMDUxMUVGIiwidmlzaXRvcl9pZCI6Ijc3NTI0MjAxOTczMjMzMTM2NDciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac2b6264b51020a4d35a1b226d376461d54e68e384076a4521e079db517f2d076b
hovercard-subject-tagissue:703804369
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/microsoftgraph/msgraph-sdk-java-auth/52/issue_layout
twitter:imagehttps://opengraph.githubassets.com/138e62ac7b68696c2902a92bb206b521d70f6a8a68a9fe5dd2a3eb7d793b274c/microsoftgraph/msgraph-sdk-java-auth/issues/52
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/138e62ac7b68696c2902a92bb206b521d70f6a8a68a9fe5dd2a3eb7d793b274c/microsoftgraph/msgraph-sdk-java-auth/issues/52
og:image:altExpected behavior ChunkedUploadProvider.upload(...) uploads the specified file and attaches it to the message, per https://docs.microsoft.com/en-us/graph/outlook-large-attachments?tabs=java. Actual...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamejball-vcra
hostnamegithub.com
expected-hostnamegithub.com
None854d880890b5e847b3fce9d1b31f032107baeddeebad2aa379c48aa4f1451f6b
turbo-cache-controlno-preview
go-importgithub.com/microsoftgraph/msgraph-sdk-java-auth git https://github.com/microsoftgraph/msgraph-sdk-java-auth.git
octolytics-dimension-user_id17304259
octolytics-dimension-user_loginmicrosoftgraph
octolytics-dimension-repository_id166441552
octolytics-dimension-repository_nwomicrosoftgraph/msgraph-sdk-java-auth
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id166441552
octolytics-dimension-repository_network_root_nwomicrosoftgraph/msgraph-sdk-java-auth
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release220e980097d94ce616d5d11fbd5316d208e3fc93
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/microsoftgraph/msgraph-sdk-java-auth/issues/52#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmicrosoftgraph%2Fmsgraph-sdk-java-auth%2Fissues%2F52
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmicrosoftgraph%2Fmsgraph-sdk-java-auth%2Fissues%2F52
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=microsoftgraph%2Fmsgraph-sdk-java-auth
Reloadhttps://github.com/microsoftgraph/msgraph-sdk-java-auth/issues/52
Reloadhttps://github.com/microsoftgraph/msgraph-sdk-java-auth/issues/52
Reloadhttps://github.com/microsoftgraph/msgraph-sdk-java-auth/issues/52
microsoftgraphhttps://github.com/microsoftgraph
msgraph-sdk-java-authhttps://github.com/microsoftgraph/msgraph-sdk-java-auth
Codehttps://github.com/microsoftgraph/msgraph-sdk-java-auth
Issues6 (6)https://github.com/microsoftgraph/msgraph-sdk-java-auth/issues
Pull requestshttps://github.com/microsoftgraph/msgraph-sdk-java-auth/pulls
Actionshttps://github.com/microsoftgraph/msgraph-sdk-java-auth/actions
Projectshttps://github.com/microsoftgraph/msgraph-sdk-java-auth/projects
Security and qualityhttps://github.com/microsoftgraph/msgraph-sdk-java-auth/security
Insightshttps://github.com/microsoftgraph/msgraph-sdk-java-auth/insights
https://github.com/microsoftgraph/msgraph-sdk-java-auth
401 when using ChunkedUploadProvider for large mail attachmentshttps://github.com/microsoftgraph/msgraph-sdk-java-auth/issues/52#top
https://github.com/baywet
bughttps://github.com/microsoftgraph/msgraph-sdk-java-auth/issues?q=state%3Aopen%20label%3A%22bug%22
promotehttps://github.com/microsoftgraph/msgraph-sdk-java-auth/issues?q=state%3Aopen%20label%3A%22promote%22
https://github.com/jball-vcra
jball-vcrahttps://github.com/jball-vcra
on Aug 18, 2020https://github.com/microsoftgraph/msgraph-sdk-java-auth/issues/52#issue-703804369
https://docs.microsoft.com/en-us/graph/outlook-large-attachments?tabs=javahttps://docs.microsoft.com/en-us/graph/outlook-large-attachments?tabs=java
https://graph.microsoft.com/https://graph.microsoft.com/
https://outlook.office.com/api/v2.0/Usershttps://outlook.office.com/api/v2.0/Users
https://outlook.office.comhttps://outlook.office.com
https://outlook.office.com/api/https://outlook.office.com/api/
https://graph.microsoft.comhttps://graph.microsoft.com
AB#5829https://microsoftgraph.visualstudio.com/0985d294-5762-4bc2-a565-161ef349ca3e/_workitems/edit/5829
jball-vcrahttps://github.com/jball-vcra
on Aug 18, 2020https://github.com/microsoftgraph/msgraph-sdk-java-auth/issues/52#event-3664109717
https://github.com/davidmoten
Dave Moten (davidmoten)https://github.com/davidmoten
on Aug 18, 2020https://github.com/microsoftgraph/msgraph-sdk-java-auth/issues/52#issuecomment-675219486
https://github.com/gantners
Stefan Gantner (gantners)https://github.com/gantners
on Aug 18, 2020https://github.com/microsoftgraph/msgraph-sdk-java-auth/issues/52#issuecomment-675466550
https://outlook.office.comhttps://outlook.office.com
https://github.com/jball-vcra
jball-vcrahttps://github.com/jball-vcra
on Aug 18, 2020https://github.com/microsoftgraph/msgraph-sdk-java-auth/issues/52#issuecomment-675622692
Stefan Gantner (@gantners)https://github.com/gantners
https://github.com/gantners
Stefan Gantner (gantners)https://github.com/gantners
on Aug 20, 2020https://github.com/microsoftgraph/msgraph-sdk-java-auth/issues/52#issuecomment-677468189
recommendation https://docs.microsoft.com/en-us/graph/outlook-large-attachments?tabs=http
https://github.com/davidmoten
Dave Moten (davidmoten)https://github.com/davidmoten
on Aug 20, 2020https://github.com/microsoftgraph/msgraph-sdk-java-auth/issues/52#issuecomment-677472254
https://github.com/gantners
Stefan Gantner (gantners)https://github.com/gantners
on Aug 20, 2020https://github.com/microsoftgraph/msgraph-sdk-java-auth/issues/52#issuecomment-677476089
https://github.com/davidmoten
Dave Moten (davidmoten)https://github.com/davidmoten
on Aug 20, 2020https://github.com/microsoftgraph/msgraph-sdk-java-auth/issues/52#issuecomment-677512860
https://github.com/davidmoten/odata-client#sending-an-email-with-an-attachmenthttps://github.com/davidmoten/odata-client#sending-an-email-with-an-attachment
https://github.com/jball-vcra
jball-vcrahttps://github.com/jball-vcra
on Aug 24, 2020https://github.com/microsoftgraph/msgraph-sdk-java-auth/issues/52#issuecomment-679381416
Michael Mainer (@MIchaelMainer)https://github.com/MIchaelMainer
Vincent Biret (baywet)https://github.com/baywet
on Sep 4, 2020https://github.com/microsoftgraph/msgraph-sdk-java-auth/issues/52#event-3729806964
Vincent Biret (baywet)https://github.com/baywet
microsoftgraph/msgraph-sdk-javahttps://github.com/microsoftgraph/msgraph-sdk-java
on Sep 17, 2020https://github.com/microsoftgraph/msgraph-sdk-java-auth/issues/52#event-3779294242
https://github.com/baywet
Vincent Biret (baywet)https://github.com/baywet
on Sep 17, 2020https://github.com/microsoftgraph/msgraph-sdk-java-auth/issues/52#issuecomment-694415555
https://github.com/microsoftgraph/msgraph-sdk-java/blob/58eddbec13a06c6485a2168ae1768724dd5bc086/src/test/java/com/microsoft/graph/functional/TestBaseAuthenticationProvider.javahttps://github.com/microsoftgraph/msgraph-sdk-java/blob/58eddbec13a06c6485a2168ae1768724dd5bc086/src/test/java/com/microsoft/graph/functional/TestBaseAuthenticationProvider.java
Vincent Biret (baywet)https://github.com/baywet
bughttps://github.com/microsoftgraph/msgraph-sdk-java-auth/issues?q=state%3Aopen%20label%3A%22bug%22
on Sep 17, 2020https://github.com/microsoftgraph/msgraph-sdk-java-auth/issues/52#event-3779330125
DeVere Dyett (ddyett)https://github.com/ddyett
promotehttps://github.com/microsoftgraph/msgraph-sdk-java-auth/issues?q=state%3Aopen%20label%3A%22promote%22
on Jan 11, 2021https://github.com/microsoftgraph/msgraph-sdk-java-auth/issues/52#event-4192768053
https://github.com/baywet
Vincent Biret (baywet)https://github.com/baywet
on Mar 16, 2021https://github.com/microsoftgraph/msgraph-sdk-java-auth/issues/52#issuecomment-800214946
microsoftgraph/msgraph-sdk-java#628https://github.com/microsoftgraph/msgraph-sdk-java/issues/628
Sign up for freehttps://github.com/signup?return_to=https://github.com/microsoftgraph/msgraph-sdk-java-auth/issues/52
Sign in to commenthttps://github.com/login?return_to=https://github.com/microsoftgraph/msgraph-sdk-java-auth/issues/52
Vincent Biret (baywet)https://github.com/baywet
bughttps://github.com/microsoftgraph/msgraph-sdk-java-auth/issues?q=state%3Aopen%20label%3A%22bug%22
promotehttps://github.com/microsoftgraph/msgraph-sdk-java-auth/issues?q=state%3Aopen%20label%3A%22promote%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Response headers:
Servergithub.com
Content-Typetext/html; charset=utf-8
Cache-Controlmax-age=0, private, must-revalidate

Viewport: width=device-width


URLs of crawlers that visited me.