The only place where sshd records how the user authenticated is in the system logs. This information is not made available to the logged-in session. The only identifying information about the origin of the connection that is made available in the environment is the IP address and port on the client, in the variables
You can add a directive in
~/.ssh/authorized_keys to set an environment variable if the user logs in with a particular key:
environment="SSH_KEY=foo" ssh-rsa AAAA…
If the user didn't log in with a key, you have no way to tell how they logged in (password,
.shosts, Kerberos, …) except by looking in the system logs (which only the system administrator can do).
If your system administrator doesn't let you modify the
authorized_keys file, you'll need to work out with them how you can do whatever it is that you want to do. Be sure to explain to them what information you need to know and why.
Note that what you did with the agent is not a reliable way of identifying the origin of the connection, and tells you nothing about how the user logged in. You'll get nothing if the user didn't forward their agent, or if they had no keys in their agent. You might get multiple keys, and there's no particular reason why the user would have used one of these keys to log in (they could have used a password, or some other key, or any other method). I don't recommend doing anything with this information, it's too unreliable.