it would be very nice to have a connector for the Enedis API. Thanks for your work!
I’m Bruno and I works on the stack (the server part of Cozy). The OAuth flow is implemented in the stack in two different ways:
- it can be a provider (for example, we can have a browser extension that can use the stack API to consume or put data in a Cozy by authenticating via OAuth)
- it can be a client for external services to help the connectors authenticate to those services.
In your case, it is the latter, and it is documented here: https://docs.cozy.io/en/cozy-stack/konnectors-workflow/#oauth-and-service-secrets. In practice, the stack will use a document in CouchDB to know the configuration of the external services.
My question is simple, is there a way to override the stack OAuth flow ?
Currently, it is not possible. It is something I’d like to add, but it’s not yet a priority.
Or is it possible for you to implement parameters for developers using the OAuth flow of the stack ?
It is possible to add parameters to the stack. But the good news is that I think it is not necessary. Let’s see:
They want a duration param on their /authorization endpoint
When configuring the authorize endpoint in the CouchDB document, you can use an URL with query string parameters, like
They give back the code + an id required for every data query.
The stack read the whole JSON response on the token endpoint, and puts the things that is not the standard fields in the
extras section of the account. So, the id should be readable by the connector.
I haven’t tested those 2 tricks, so don’t hesitate to ask us if you have any issue.