Using OAuth 2.0 to Access EtMDB API Endpoints

EtMDB API use the OAuth 2.0 standard for authentication and authorization. EtMDB supports common OAuth 2.0 scenarios such as those for web server, installed, and client-side applications.

Application management views

  • Register Application
  • Create a new application or get the list of applications

  • Replace $APPLICATION-ID on the URL
  • Application details: "https://etmdb.com/api/oauth/applications/$APPLICATION-ID/"
  • Update Application: "https://etmdb.com/api/oauth/applications/$APPLICATION-ID/update/"
  • Delete Application: "https://etmdb.com/api/oauth/applications/$APPLICATION-ID/delete/"
  • Token management views
    Access token URL

    curl -X $HTTP_METHOD "https://etmdb.com/api/oauth/token/"

    Get the list of authorized access token and you can revoke them

    curl -X $HTTP_METHOD "https://etmdb.com/api/oauth/authorized-tokens/"

    Delete Authorizated access token with ID

    curl -X $HTTP_METHOD "https://etmdb.com/api/oauth/authorized-tokens/$ACCESS-TOKEN-ID/delete/"

    Access token and refresh token with one to these two methods below

    curl -X $HTTP_METHOD -d "grant_type=password&username=$USERNAME&password=$PASSWORD&scope=$SCOPE" -u "$CLIENT-ID:$CLIENT-SECRET-KEY" "https://etmdb.com/api/oauth/token/"

    curl -X $HTTP_METHOD -d "grant_type=password&username=$USERNAME&password=$PASSWORD&scope=$SCOPE" -u "https://$CLIENT-ID:$CLIENT-SECRET-KEY@etmdb.com/api/oauth/token/"

    Sucessful return result when getting access and refresh token
    {"refresh_token": "$REFRESH-TOKEN", "token_type": "$TOKEN-TYPE", "expires_in": 36000, "scope": "$SCOPE", "access_token": "$ACCESS-TOKEN"}

    Check grand type
    {"error": "unsupported_grant_type"}

    Client id or secret incorrect
    {"error": "unauthorized_client"}

    Client not valid
    {"error": "invalid_client"}

    Scope incorrect
    {"error": "invalid_scope"}

    Password or username incorrect
    {"error_description": "Invalid credentials given.", "error": "invalid_grant"}

    Last update on:Nov. 14, 2017, 9:36 p.m.by EtMDB API Developers