# easyroam Service

# Registering a new easyroam service

  • Go to https://auth.easyroam.de/console/applications (make sure that you are logged-in) and click on the
    Create new appplication button.
  • Make sure the service application type is selected and the Activate client switch is toggled on.
  • Enter a name for your application.
  • Enter a client uri that resolves to the client making the API calls.
  • Select all scopes your API client is going to use. Since you are creating a service, which operates outside of the user context you can't select the openid and offline_access scopes.

# Client details

After clicking on the Create application button you will receive your client_id and client_secret.

  • Your client_id will be displayed every time you visit the application site in the authentication console and will look something like this: 123456.easyroam.auth
  • Your client_secret will only be displayed ONCE! Make sure you save it somewhere safe.

# Authenticating

Once you have your client_id and client_secret your service can authenticate itself.

Authentication is achived by submitting an HTTP form:

POST https://auth.easyroam.de/oauth/token
grant_type=client_credentials
client_id=<your_client_id>
client_secret=<your_client_secret>

Upon a successful authentication you will receive a Json object containing 2 properties like so:

{
    "access_token": "...",
    "token_type": "Bearer"
}
import requests

creds = {
    "grant_type": "client_credentials",
    "client_id": "<your_client_id>",
    "client_secret": "<your_client_secret>"
}

r = requests.post(
    "https://auth.easyroam.de/oauth/token",
    data=creds
)
r_json = r.json()

access_token = r_json["access_token"]

print(access_token)
const axios = require('axios');

const creds = {
    grant_type: "client_credentials",
    client_id: '<your_client_id>',
    client_secret: '<your_client_secret>'
};

const resp = await axios({
    method: 'POST',
    url: `https://auth.easyroam.de/oauth/token`,
    data: creds
});

const { access_token } = resp.data;
console.log(access_token);

For a more complex example check out our example easyroam service.