How to obtain the user_id so I can issue a logout API call

GET https://example.com/u/USERNAME.json

Since you implement SSO, you have the external_id of the user, so you can use:

GET https://example.com/u/by-external/EXTERNAL_ID