3

When looking at the traffic while using Swisscom's myCloud web client, a bearer token is used for all interaction between the client and the server (storage.prod.mdl.swisscom.ch):

Authorization: Bearer 5E9Ra2n2kwI7JZDoy1f7og==

(this token is fake, obviously).

How can I obtain such a bearer token, using my Swisscom Passeport login and password? An example using curl is preferred.

Also, is there any documentation available regarding myCloud's API?

Ivanov
  • 2,271
  • 2
  • 19
  • 34
watain
  • 4,082
  • 4
  • 29
  • 33
  • You could take a look at the following project: https://github.com/ThomasGassmann/swisscom-my-cloud-backup Bearer tokens are obtained automatically as well (see `mycloud/mycloudapi/auth/bearer_token.py`) – Thomas Gassmann Jul 24 '18 at 15:03
  • 1
    @ThomasGassmann I've already stumbled upon your project, using Selenium or a similar software currently seems to be the only way to automatically fetch a token, unfortunately (just as I do it too). I can't understand why Swisscom won't use standardized OAuth in order for developers to obtain a bearer token. – watain Jul 25 '18 at 08:16

1 Answers1

5

You have to follow the OAuth authentication flow from the Swisscom Passeport. Since Swisscom Passeport does not have an open API (as far as I know), you could make a PhantomJS script to enter the username and password and submit the login. Once the login is made, you should follow the HTTP redirects and get the access token.

I know you didn't want hear such answer, but, at the moment, I think there's no curl-friendly manner to login to myCloud.

EDIT: Just to provide you the most complete answer: at the moment myCloud does not have any public API documentation. However, there are on-going discussions to open the API.

gsmachado
  • 188
  • 8