/Api/AuthenticateApiUser
Parameters: jwt : String
Required Claims:
Used for APIs to authenticate their users. Returns a JWT token which your application can to give to its callers and verify on its own with a jwt library. Don't use for GUI apps. WARNING: Your application must be authorized to use this method
Sample Response:
{ "success": true, "jwt": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3NDU1OTkzODIsImV4cCI6MTc0NTYxMzc4MiwidXNlcklkIjoidHN0X3NhbXBsZSIsImNsaWVudElkIjoidHN0IiwiZW1haWwiOiJzb21ldXNlckBzb21lZW1haWwuY29tIn0.mVJgyUmyhOF-kq_58S1QBhdX2T9DP6tJ-NUCIGW-4oQ" }
/Api/AuthenticateApiUserWithSession
Parameters: jwt : String
Required Claims:
Used for APIs to authenticate their users. Returns a JWT token which your application can to give to its callers and verify on its own with a jwt library. Don't use for GUI apps. WARNING: Your application must be authorized to use this method
Sample Response:
{ "success": true, "jwt": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3NDU1OTkzODIsImV4cCI6MTc0NTYxMzc4MiwidXNlcklkIjoidHN0X3NhbXBsZSIsInN1YiI6InNlc3Npb25faWQiLCJjbGllbnRJZCI6InRzdCIsImVtYWlsIjoic29tZXVzZXJAc29tZWVtYWlsLmNvbSJ9.MVVsI-vwZVRobSAGotHSe6c5Dd8ITIuil2Edh1QJmD0" }
/Api/ExtendSession
Parameters: jwt : String exh : Int32
Required Claims:
Extend valid token session timeout by extension time in hours[1-4]. Refer this page for more details at https://wiki.office.comscore.com/display/CSD/JWT+Api+-+Extend+Session+endpoint
Sample Response:
{ "success": true }
/Api/Heartbeat
Parameters: NONE
Checks if the system is online.
Sample Response:
{ "isAlive": true }
/Api/LoginUrl
Parameters: NONE
Url to redirect user to if they do not have a valid session.
Sample Response:
{ "loginUrl": "https://auth2.comscore.com/Authenticate.aspx" }
/Api/LogoutUrl
Parameters: NONE
Url to redirect user to if you want them to be logged out.
Sample Response:
{ "logoutUrl": "https://auth2.comscore.com/logout" }
/Api/Session
Parameters: sub : String exh : Int32
Checks if the session is still valid for the given identifier.
Sample Response:
{ "isValid": false }
/Api/ShareToken
Parameters: jwt : String a : String
Required Claims:
Share token with registered app. Source app jwt token [jwt], Destination app code [a]. WARNING: Your application must be authorized to use this method
Sample Response:
{ "success": true, "jwt": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3NDU1OTkzODIsImV4cCI6MTc0NTYxMzc4MiwidXNlcklkIjoidHN0X3NhbXBsZSIsInN1YiI6InNlc3Npb25faWQiLCJjbGllbnRJZCI6InRzdCIsImVtYWlsIjoic29tZXVzZXJAc29tZWVtYWlsLmNvbSJ9.MVVsI-vwZVRobSAGotHSe6c5Dd8ITIuil2Edh1QJmD0" }
/Api/User
Parameters: jwt : String
Required Claims:
Returns information about the user.
Sample Response:
{ "userId": "tst_sample1999", "isComscore": false, "isImpersonation": false, "impersonator": null, "email": "tst_sample@mymetrix.com", "clientId": "tst", "groups": [ "group1", "group2" ], "clientName": "Test Company", "UserFirstName": null, "UserLastName": null }
/Api/ValidateToken
Parameters: jwt : String
You may optionally call this method if you do not have the facilities to thoroughly validate the token you recieved from the user. You should do at least minimum validation on your end before calling this. This method will also check that the session is valid. Remember, the same token will not be valid more than once.
Sample Response:
{ "isValid": false, "message": "invalid token" }