This section explains how to authenticate into W3Block services ecosystem
All of W3block API services shares the same authentication that can be obtained using ID services. Basically, ID controls all of users, companies and permissions and besides that, it can generate JWT tokens that can be used to authenticate requests into our entire ecosystem. Above you can see our authentication flow.
W3block authentication flow
How to Authenticate
To authenticate, you must use the ID services API endpoint above:
If you want to authenticate some user registered in your tenant base, you can use the following sdk code:
Authenticating as tenant
Sometimes you want to integrate some application into our service. This way, is not common to authenticate as a common user, so you want to authenticate as a tenant or basically using a tenant api key and secret. Above you can see some example on how to authenticate using this method.
Using the authentication token in our api services
To be authenticated into our api services, you must pass the obtained jwt token into the Authorization request header using the pattern of bearer tokens
Example:
Authorization: Bearer <JWT token>
You can also directly authenticate into our services using the tenant credentials without getting the tenant jwt token. To do that, you just need to inform in the request headers the following params:
x-w3block-id: Your tenant id
x-w3block-api-key: Your tenant api key
x-w3block-secret: Your tenant api secret
This way, the api service that you're calling will automatically handle the tenant authentication without the need of manually get the JWT token as example above.