Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement auth factory #321

Open
7 tasks
iMicknl opened this issue Jan 17, 2022 · 1 comment · May be fixed by #767
Open
7 tasks

Implement auth factory #321

iMicknl opened this issue Jan 17, 2022 · 1 comment · May be fixed by #767
Assignees
Labels

Comments

@iMicknl
Copy link
Owner

iMicknl commented Jan 17, 2022

As discussed it would be good to implement some kind of authentication factory per server.

Eventually it would be great to investigate

Manufacturers

  • Atlantic Cozytouch -> JWT / OAuth?

# CozyTouch authentication using jwt
if self.server == SUPPORTED_SERVERS["atlantic_cozytouch"]:
jwt = await self.cozytouch_login()
payload = {"jwt": jwt}

Need to investigate if we can just pass this as a Bearer token to requests as well.

Uses bearer token in header, need to handle token refresh
Would the Somfy official API client id / secret work as well?

Endpoint is different (/enduser-mobile-web/1/enduserAPI/) and requires X-Auth-Token header.
/login endpoint doesn't exist, verify with checking another endpoint (/setup?).

self.headers.update ({
     "X-Auth-Token": self.api_token
})
@tetienne
Copy link
Collaborator

I think we should expose an interface where a get and post methods must be implemented. And behind, the implementation does what it wants.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants