Skip to content
This repository was archived by the owner on Mar 27, 2025. It is now read-only.

Conversation

@matthijskooijman
Copy link
Collaborator

Additionally, fix an outdated import path related to the migration from bcmi-labs to arduino.

This repository was renamed, but the old bcmi-labs version was still
used in the code. Since github redirects renamed repositories, things
still worked if you cloned from the new repo, but you would end up with
two copies of the repository, with the "auth" subpackage being used from
the other copy.
The site returns a correct cookie for the / path, but also a bunch of
empty cookies for other paths. To get the right one, without hardcoding
any paths, this just uses the first non-empty cookie it finds.

$ https://hydra.arduino.cc/oauth2/auth?client_id=connector&redirect_uri=http%3A%2F%2Flocalhost%3A5000&response_type=code&scope=iot%3Adevices&state=PCiHbBDK
(...)
Location: https://auth.arduino.cc/login/?challenge=eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOiJjb25uZWN0b3IiLCJleHAiOjE1MTMwOTcyMTQsImp0aSI6ImVkOTk3MTNhLWVkYzQtNGI2Yy1iNjIwLWZiMjFkMDQ3OWU2NCIsInJlZGlyIjoiaHR0cHM6Ly9oeWRyYS5hcmR1aW5vLmNjL29hdXRoMi9hdXRoP2NsaWVudF9pZD1jb25uZWN0b3JcdTAwMjZyZWRpcmVjdF91cmk9aHR0cCUzQSUyRiUyRmxvY2FsaG9zdCUzQTUwMDBcdTAwMjZyZXNwb25zZV90eXBlPWNvZGVcdTAwMjZzY29wZT1pb3QlM0FkZXZpY2VzXHUwMDI2c3RhdGU9UENpSGJCREsiLCJzY3AiOlsiaW90OmRldmljZXMiXX0.YYtVsgyd-ZUN2iwzwHAZV9rUBYc8Fxei6vCgj5WN_c3c_nQDbOmWSpxFVPAL6jYyCeaKbe98NfDxpeXeI_PHR0B6kgpreuldIILY3fG9CVm2JI2abcji_jY5Sdxw5ppjRaj_n8gDjkgxu2X0-gjo6WO7ZCJi6cn9332yBZEgtpzAF1ZT1za6ricJnlvZLJSN6oqV2QentQoScY9EoTsggq-klFHo_i9EgDmIQc6CNr_kuDc72PkslwYoprGH13GrqKGnSdz2y8Y2RYCldzVA4BhVb0K8H9pmMj4Tbkdx1HPPglfFeom0Xet3OdcGjsSB1_wIH7L-5-FoHioPsXqVw_7-jf5rOgWA-_2EcVS7lBwPOcaY_3l8cJVuFvp73psWdd1otEujORsUG6teeQDIBp2HYcVDKXJV4wyWKImJKdP_xNK850Vqn_Dc-fcuWjmXClaKULj5RIIlH4kfGGIxl9nz66DPpV4y8tmCtjHybo_L2_CPXPoazKbhzSfGz0775eepZWxpoMkJYEgG650AZqmrN66NNyeS5AUJMKr-N4r-QzPD2CePZYuch2ABT9cnQXIJ55zpTu45wN0mTKESVj_pggvZIc3qnGwelPAOaNNhYLtgMVqJwFiHiJbmeD-esZdjYIcISOzWPekL1Lgxj9gCajuIT8OKBw88ikspbTo
[following]
HTTP request sent, awaiting response...
  HTTP/1.1 200 OK
  Date: Tue, 12 Dec 2017 16:36:55 GMT
  Content-Type: text/html
  Transfer-Encoding: chunked
  Connection: keep-alive
  Set-Cookie: (redacted)
  Server: nginx/1.13.7
  Set-Cookie: _csrf=bJMtvqdQbUiStguu; Path=/
  Set-Cookie: _csrf=; Path=/login/; Expires=Mon, 12 Dec 2016 16:36:55 GMT
  Set-Cookie: _csrf=; Path=/email/confirm/; Expires=Mon, 12 Dec 2016 16:36:55 GMT
  Set-Cookie: _csrf=; Path=/email/; Expires=Mon, 12 Dec 2016 16:36:55 GMT
  Set-Cookie: _csrf=; Path=/register/; Expires=Mon, 12 Dec 2016 16:36:55 GMT
  Set-Cookie: _csrf=; Path=/reset/; Expires=Mon, 12 Dec 2016 16:36:55 GMT
  Set-Cookie: _csrf=; Path=/login; Expires=Mon, 12 Dec 2016 16:36:55 GMT
  Set-Cookie: _csrf=; Path=/email/confirm; Expires=Mon, 12 Dec 2016 16:36:55 GMT
  Set-Cookie: _csrf=; Path=/email; Expires=Mon, 12 Dec 2016 16:36:55 GMT
  Set-Cookie: _csrf=; Path=/register; Expires=Mon, 12 Dec 2016 16:36:55 GMT
  Set-Cookie: _csrf=; Path=/reset; Expires=Mon, 12 Dec 2016 16:36:55 GMT
  Set-Cookie: arduino_sso=; Path=/; Expires=Tue, 12 Dec 2017 16:31:55 GMT
  Set-Cookie: arduino_authenticated=false; Path=/; Domain=arduino.cc; Expires=Wed, 13 Dec 2017 16:36:55 GMT
@mastrolinux mastrolinux merged commit e25dde3 into arduino:master Dec 13, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants