René's URL Explorer Experiment


Title: IllegalArgumentException from 401 responses · Issue #1078 · scribejava/scribejava · GitHub

Open Graph Title: IllegalArgumentException from 401 responses · Issue #1078 · scribejava/scribejava

X Title: IllegalArgumentException from 401 responses · Issue #1078 · scribejava/scribejava

Description: Hi! I recently encountered a problem which seems to be somehow related to #492 It seems that the OAuth request behaves differently depending on whether the REST client is running locally or in a docker container in a cloud environment. F...

Open Graph Description: Hi! I recently encountered a problem which seems to be somehow related to #492 It seems that the OAuth request behaves differently depending on whether the REST client is running locally or in a do...

X Description: Hi! I recently encountered a problem which seems to be somehow related to #492 It seems that the OAuth request behaves differently depending on whether the REST client is running locally or in a do...

Opengraph URL: https://github.com/scribejava/scribejava/issues/1078

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"IllegalArgumentException from 401 responses","articleBody":"Hi!\r\n\r\nI recently encountered a problem which seems to be somehow related to #492\r\n\r\nIt seems that the OAuth request behaves differently depending on whether the REST client is running locally or in a docker container in a cloud environment.\r\nFor the first case, when we use a wrong clientId for authentication, a 401 response with a body is received, which is logged in debug mode (in method `OAuth20Service.sendAccessTokenRequestSync()`) like follows:\r\n```\r\ncreated access token client credentials grant request with body params [grant_type=client_credentials], query string params []\r\nsend request for access token synchronously to https://...\r\nresponse status code: 401\r\nresponse body: {\"error\":\"unauthorized\",\"error_description\":\"Full authentication is required to access this resource\"}\r\n```\r\n\r\nI have absolutely no idea where the \"response body\" is taken from because it is 100% sure that the service doesn't send a body for a 401 response - it is simply empty (tested with curl, postman etc.)\r\n\r\nNow, when our client is running in the cloud (and contacting the exact same service), the response is null:\r\n```\r\ncreated access token client credentials grant request with body params [grant_type=client_credentials], query string params []\r\nsend request for access token synchronously to https://...\r\nresponse status code: 401\r\nresponse body: null\r\n```\r\n\r\nIn this case, an exception is thrown in `OAuth2AccessTokenJsonExtractor.extract()`:\r\n```\r\n java.lang.IllegalArgumentException: Response body is incorrect. Can't extract a token from an empty string\r\n\tat com.github.scribejava.core.utils.Preconditions.check(Preconditions.java:49)\r\n\tat com.github.scribejava.core.utils.Preconditions.checkEmptyString(Preconditions.java:31)\r\n\tat com.github.scribejava.core.extractors.OAuth2AccessTokenJsonExtractor.extract(OAuth2AccessTokenJsonExtractor.java:34)\r\n\tat com.github.scribejava.core.extractors.OAuth2AccessTokenJsonExtractor.extract(OAuth2AccessTokenJsonExtractor.java:17)\r\n\tat com.github.scribejava.core.oauth.OAuth20Service.sendAccessTokenRequestSync(OAuth20Service.java:157)\r\n\tat com.github.scribejava.core.oauth.OAuth20Service.getAccessTokenClientCredentialsGrant(OAuth20Service.java:418)\r\n```\r\n\r\nBecause of that, I am wondering: Why should it be a problem if there is no response body when we receive a 401 response? Actually, according to the HTTP code it is clear that there won't be an OAuth token and there will be nothing that could be extracted from the response. Besides this, the `generateError()` method which would be called afterwards does also allow the variables errorUri, errorCode and errorDescription to be null when throwing the `OAuth2AccessTokenErrorResponse` exception.\r\n\r\nThus, I think that the check for an empty string might be too early und should be placed below the if-statement, isn't it?\r\nThanks!","author":{"url":"https://github.com/Steinbam","@type":"Person","name":"Steinbam"},"datePublished":"2024-12-13T15:03:59.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/1078/scribejava/issues/1078"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:e774fc3f-022a-0c6d-2d0b-4c9628354767
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id8876:13F113:5CB119B:7E44339:6973784A
html-safe-noncee488755d12afd4160087de8441c40232256d5fa629a736edc9901578ce49dad2
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4ODc2OjEzRjExMzo1Q0IxMTlCOjdFNDQzMzk6Njk3Mzc4NEEiLCJ2aXNpdG9yX2lkIjoiMzUzODgyNDQzNjg1ODk3NjMzMCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac2c0b52ec85b320f5a314dc18c72c5dc014e42fbcfcbe9af95b9c332830844a21
hovercard-subject-tagissue:2738598705
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/scribejava/scribejava/1078/issue_layout
twitter:imagehttps://opengraph.githubassets.com/ec6287eafb87c2a7001f3b8a5f11660d9517360aa9bfc7c8f75e6bfd537d3958/scribejava/scribejava/issues/1078
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/ec6287eafb87c2a7001f3b8a5f11660d9517360aa9bfc7c8f75e6bfd537d3958/scribejava/scribejava/issues/1078
og:image:altHi! I recently encountered a problem which seems to be somehow related to #492 It seems that the OAuth request behaves differently depending on whether the REST client is running locally or in a do...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameSteinbam
hostnamegithub.com
expected-hostnamegithub.com
None4cf879a11b0a28a85543899a36aaee9ec9ca2fb7bedad86c0da5731193c95f01
turbo-cache-controlno-preview
go-importgithub.com/scribejava/scribejava git https://github.com/scribejava/scribejava.git
octolytics-dimension-user_id15140551
octolytics-dimension-user_loginscribejava
octolytics-dimension-repository_id889932
octolytics-dimension-repository_nwoscribejava/scribejava
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id889932
octolytics-dimension-repository_network_root_nwoscribejava/scribejava
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
releasefe8be790582ef7a55477ce1918ac0ed16b106d31
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/scribejava/scribejava/issues/1078#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fscribejava%2Fscribejava%2Fissues%2F1078
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
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
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://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/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fscribejava%2Fscribejava%2Fissues%2F1078
Sign up https://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=scribejava%2Fscribejava
Reloadhttps://github.com/scribejava/scribejava/issues/1078
Reloadhttps://github.com/scribejava/scribejava/issues/1078
Reloadhttps://github.com/scribejava/scribejava/issues/1078
scribejava https://github.com/scribejava
scribejavahttps://github.com/scribejava/scribejava
Please reload this pagehttps://github.com/scribejava/scribejava/issues/1078
Notifications https://github.com/login?return_to=%2Fscribejava%2Fscribejava
Fork 1.7k https://github.com/login?return_to=%2Fscribejava%2Fscribejava
Star 5.5k https://github.com/login?return_to=%2Fscribejava%2Fscribejava
Code https://github.com/scribejava/scribejava
Issues 44 https://github.com/scribejava/scribejava/issues
Pull requests 30 https://github.com/scribejava/scribejava/pulls
Actions https://github.com/scribejava/scribejava/actions
Projects 0 https://github.com/scribejava/scribejava/projects
Wiki https://github.com/scribejava/scribejava/wiki
Security 0 https://github.com/scribejava/scribejava/security
Insights https://github.com/scribejava/scribejava/pulse
Code https://github.com/scribejava/scribejava
Issues https://github.com/scribejava/scribejava/issues
Pull requests https://github.com/scribejava/scribejava/pulls
Actions https://github.com/scribejava/scribejava/actions
Projects https://github.com/scribejava/scribejava/projects
Wiki https://github.com/scribejava/scribejava/wiki
Security https://github.com/scribejava/scribejava/security
Insights https://github.com/scribejava/scribejava/pulse
New issuehttps://github.com/login?return_to=https://github.com/scribejava/scribejava/issues/1078
New issuehttps://github.com/login?return_to=https://github.com/scribejava/scribejava/issues/1078
IllegalArgumentException from 401 responseshttps://github.com/scribejava/scribejava/issues/1078#top
https://github.com/Steinbam
https://github.com/Steinbam
Steinbamhttps://github.com/Steinbam
on Dec 13, 2024https://github.com/scribejava/scribejava/issues/1078#issue-2738598705
#492https://github.com/scribejava/scribejava/issues/492
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

Viewport: width=device-width


URLs of crawlers that visited me.