Yes, you can do this by going to the cloud-code tab of your game's portal and navigating to responses -> Authentication Response
Any code you put here will run when the player authenticates, and you can get auth-details and auth errors using Spark.getData() as you would with info coming into a request.
Something i would advise in your execution if your player's friends list gets very large is to look into bulk jobs [here].
What you dont want to happen upon login is to have the auth-response slowed down while you send off these messages to friends, so bulk jobs or schedulers will take the load off the server when you preform authentication.
However, you really only have to worry about this when there are 100's of friends and tens of thousands of concurrent users.
Let me know if that makes sense?
We have a function for that in our SparkPlayer API.