Changes to user_saml application

I want to add custom hook function to login function in user_saml app. Is there any other way to add the code instead of customizing the core application? Like creating a separate add-on application.