Hi there and welcome
When you try to sign in on the iPhone, what is the exact message you get when it fails?
And exactly where are you trying to sign in?
Please let me know.
On your iPhone, open Safari and go to www.icloud.com and try to sign in.
What then happens?
ok, it sounds like your iPhone has been deauthorized
Do you still see your apps on it?
ok, do you have data on the iPhone you need to keep?
do you have data on the iPhone you need to keep?
ok, you can access them now correct?
the text messages
ok, are you able to install any apps now?
ok, then you will not be able to back up your text sorry, you will have proceed with the reset
this will return the phone to new so you can again authorize it.
To do this go to Settings, General, Reset, Erase all content and reset settings.
Let this complete and when it has, setup the iPhone with your Apple Id
Let me know the results please.