API Authentication
API Authentication with JWT Tokens
To securely access the Wogeez API, authentication is handled through JWT (JSON Web Token) tokens, utilizing the OpenID Connect protocol. This approach ensures a streamlined and standardized process for user authentication and secure access to resources.
After logging in with your user credentials, you can obtain a JWT token from the authentication service via the OpenID Connect flow. This token must be included in the headers of each API request, serving as proof of identity and permissions for accessing Wogeez resources. Tokens are time-limited, so periodic refreshes may be required to maintain access.
This secure, OpenID Connect-based method ensures that all interactions with the Wogeez API are authenticated, providing consistent identity verification and secure resource management.
Locating the OpenID Configuration File
To facilitate integration with the OpenID Connect authentication service, Wogeez provides an endpoint for retrieving essential configuration details. The file .well-known/openid-configuration is accessible at the root of the authentication server. This file contains important information, such as the authorization and token endpoints, which are necessary for securely obtaining and using JWT tokens with Wogeez.
To access this file, make a GET request to the following URL structure:
curl -X GET "https://auth.wogeez.com/realms/wogeez/.well-known/openid-configuration"
Creating an account
Please refer to user documentation
Obtaining a JWT Token via Username and Password
To access the JWT token, you can authenticate by sending a POST request to the token endpoint, providing your login credentials as client_id, username, password, and grant_type. This request will return a JWT token that can be used for all future API requests.
curl -X POST "https://auth.wogeez.com/realms/wogeez/protocol/openid-connect/token" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "client_id=wogeez-api" \
-d "username=your-username" \
-d "password=your-password" \
-d "grant_type=password"
Warning
When sending sensitive information such as usernames and passwords, it’s essential to ensure that these credentials are properly URL-encoded. This means that special characters in the username or password should be converted to a format that can be transmitted over the internet safely. For example, spaces should be encoded as %20, and other special characters should be appropriately encoded as well.
Upon successful authentication, the server will respond with a JSON object that includes the JWT token, which you can then use in the Authorization header for subsequent API calls:
{
"access_token": "your-jwt-token",
"expires_in": 3600,
"token_type": "Bearer"
}
You can include the access_token in your API requests like this:
This setup allows you to authenticate and manage your resources securely through the Wogeez API.