You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Enode requires us to obtain an access token from their API in order to use the main endpoints in their API. The way they do this is through "Basic" HTTP Authentication scheme. What this involves is sending our Enode client credentials (client ID as username and client secret as password), over to Enode's access token fetch endpoint via that auth scheme. Fortunately, the HTTP Python library we'll be using (https://www.python-httpx.org/), handles Basic authentication for us (https://www.python-httpx.org/quickstart/#authentication).
Once we've got a token, it makes sense to continue to reuse it over the course of the hour it's useable, until it must be refreshed. To do this, we'll store the token in OCF's database under a new table, found here. This table has a helper function you can use to actually get the token without accessing SQL models.
Enode requires us to obtain an access token from their API in order to use the main endpoints in their API. The way they do this is through "Basic" HTTP Authentication scheme. What this involves is sending our Enode client credentials (client ID as username and client secret as password), over to Enode's access token fetch endpoint via that auth scheme. Fortunately, the HTTP Python library we'll be using (https://www.python-httpx.org/), handles Basic authentication for us (https://www.python-httpx.org/quickstart/#authentication).
Once we've got a token, it makes sense to continue to reuse it over the course of the hour it's useable, until it must be refreshed. To do this, we'll store the token in OCF's database under a new table, found here. This table has a helper function you can use to actually get the token without accessing SQL models.
See here for our current implementation in TypeScript.
The text was updated successfully, but these errors were encountered: