This might be what you're looking for https://www.ibm.com/docs/en/was-liberty/base?topic=security-public-apis.
That API allows you to access the security subject.