JanssenProject / docs

Janssen Documentation
Apache License 2.0
0 stars 0 forks source link

Docs: add stat endpoint description #19

Open yuriyz opened 2 years ago

yuriyz commented 2 years ago

See https://github.com/GluuFederation/oxAuth/issues/1512#issuecomment-768926617

moabu commented 2 years ago

To help :

Access monthly active users endpoint:

  1. Created a new client with the below details. I didn't change any settings beside whats in the Standard settings:

    OPENID CONNECT CLIENTS DETAILS

    • Name: test
    • Client ID: 9cc66d49-31f1-4a12-b1c2-c38f77417b40
    • Subject Type: pairwise
    • ClientSecret: XXXXXXXXXXX
    • Application Type: web
    • Persist Client Authorizations: true
    • Pre-Authorization: false
    • Authentication method for the Token Endpoint: client_secret_basic
    • Logout Session Required: false
    • Include Claims In Id Token: false
    • Disabled: false
    • Scopes: [openid]
    • Grant types: [client_credentials]
    • Response types: [token]
  2. Curl or add to prometheus the client details with the endpoint. the path can be /oxauth/ or /jans-auth depending if Gluu or Janssen.

curl -k https://test.gluu.org/jans-auth/restv1/internal/stat?month=202106 -u "9cc66d49-31f1-4a12-b1c2-c38f77417b40:2E585aiKkE26xmZXDXJdiI9qhTvqtKfeUXKac4z6"
{"response":{"202107":{"monthly_active_users":0,"token_count_per_granttype":{}}}}

Forexample stats for May 2021 in openmetric format would look like this:

/jans-auth/restv1/internal/stat?month=202105&format=openmetric