Ok, thank you luceos
I alreadey achieved the login via SSO with Wordpress.
The problem I am trying to solve is to restrict Guest Access to Flarum, if the user is not authenticated to redirect them to Wordpress login.
I will search some more info and if I don't find anything I will try to make a basic extension for this.