Title: The sample app callback uri is not compliant with the Procore API. · Issue #4 · procore/Procore-Sample-Python · GitHub
Open Graph Title: The sample app callback uri is not compliant with the Procore API. · Issue #4 · procore/Procore-Sample-Python
X Title: The sample app callback uri is not compliant with the Procore API. · Issue #4 · procore/Procore-Sample-Python
Description: The Procore API reference states that the only http callback URI that is acceptable is "http://localhost". The sample app uses a callback URI of "http://localhost:3000/users/home" which is rejected by the Procore API at runtime. In order...
Open Graph Description: The Procore API reference states that the only http callback URI that is acceptable is "http://localhost". The sample app uses a callback URI of "http://localhost:3000/users/home" which is rejected...
X Description: The Procore API reference states that the only http callback URI that is acceptable is "http://localhost". The sample app uses a callback URI of "http://localhost:3000/users/home&quo...
Opengraph URL: https://github.com/procore/Procore-Sample-Python/issues/4
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"The sample app callback uri is not compliant with the Procore API.","articleBody":"The Procore API reference states that the only http callback URI that is acceptable is \"http://localhost\". The sample app uses a callback URI of \"http://localhost:3000/users/home\" which is rejected by the Procore API at runtime. In order to fix this I had to add the code below into the oath_main file:\r\n```\r\ncallbackapp = Flask(__name__)\r\n\r\n@callbackapp.route('/',methods=[\"GET\", \"POST\"])\r\ndef app_callback1():\r\n if request.method == \"GET\":\r\n if session.get('bool') is False:\r\n code = request.args.get('code')\r\n cburl= f'{REDIRECT_URI}?code={code}'\r\n return redirect(cburl)\r\n```\r\n\r\nand then run a separate python script to run it before spinning up the main server on port 3000, coded as follows:\r\n\r\n```\r\nfrom oauth_main import callbackapp\r\n\r\n#------- Runs the callback application ------\r\ncallbackapp.run(debug=True, port=80)\r\n```\r\n\r\nI then had to change all functions that were sending a callback URI to Procore to use http://localhost, which I just hardcoded since it isn't optional.\r\nthese functions were:\r\n\r\n- `make_authorization_url()`\r\n- `get_token(code)`\r\n\r\n\r\n**The issues are twofold:**\r\n\r\n1. The Procore-Official sample app doesn't follow Procore's requirements for callback URIs and therefore is not a currently functioning sample\r\n2. The Procore API does not recognize endpoints at http://localhost/[ENDPOINT HERE] or on other ports. This should be changed to allow any endpoint or port on the local machine - it is far too limiting and clumsy to have to listen on port 80 while running everything else on a different port.","author":{"url":"https://github.com/perrinromney","@type":"Person","name":"perrinromney"},"datePublished":"2022-08-13T01:39:37Z","url":"https://github.com/procore/Procore-Sample-Python/issues/4"}
| react-profiling | 0 |
| react-import-map | react,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-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:f1341405-69f8-c9bf-f846-bbc1d19cfdae |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8BFC:3204C8:203E9B9:29A6A68:6AFFDBA6 |
| html-safe-nonce | 43dfaabb437fe2bdc542706cec9e6571f84db7766d359fbf74be0039e66f05e8 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4QkZDOjMyMDRDODoyMDNFOUI5OjI5QTZBNjg6NkFGRkRCQTYiLCJ2aXNpdG9yX2lkIjoiMTU3MDIwOTIzMzExNzM3MTMwMiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | bf6c6c9c9e3a7a6294ab766bda92e7014813d28a190b0e2b6df6c5f73c9a68c8 |
| hovercard-subject-tag | issue:1337821513 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/procore/Procore-Sample-Python/4/issue_layout |
| twitter:image | https://opengraph.githubassets.com/82c7a541c6d28ea1b3fcf8017b1a9113536f0b70c2bdfe6ef594a902551880e4/procore/Procore-Sample-Python/issues/4 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/82c7a541c6d28ea1b3fcf8017b1a9113536f0b70c2bdfe6ef594a902551880e4/procore/Procore-Sample-Python/issues/4 |
| og:image:alt | The Procore API reference states that the only http callback URI that is acceptable is "http://localhost". The sample app uses a callback URI of "http://localhost:3000/users/home" which is rejected... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | perrinromney |
| hostname | github.com |
| expected-hostname | github.com |
| None | 0a0d8686a27478df474dd7415776a7a080cde8838b3cd92ea7601187572e5729 |
| turbo-cache-control | no-preview |
| go-import | github.com/procore/Procore-Sample-Python git https://github.com/procore/Procore-Sample-Python.git |
| octolytics-dimension-user_id | 145387 |
| octolytics-dimension-user_login | procore |
| octolytics-dimension-repository_id | 279956845 |
| octolytics-dimension-repository_nwo | procore/Procore-Sample-Python |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 279956845 |
| octolytics-dimension-repository_network_root_nwo | procore/Procore-Sample-Python |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 16a11879678aaf97e2a42c33ee70830aa084fa37 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width