How do you get the sql server username of the currently executing command in a CLR Trigger?

sql-server, sqlclr

Solution

Try using `SUSER_NAME()` function in SQL server. This will return the current user.

Problem

I know that SqlContext.WindowsIdentity returns the current user that is executing the command (in a CLR trigger), however, this only works for windows authenticated users. How do I get the username if it's a sql server user instead? Any help is appreciated.

Original source