Basic Auth is being “phased out” by many providers, including Microsoft. I saw a nice video about Microsoft Identity (prepared for the M365 Developer Exam) that does a really nice job explaining token authentication. Just throwing that out there for anyone and not Michael.
Microsoft identity platform: Getting Started with Microsoft identity - YouTube
I haven’t tried it but there is a session service with a logout method:
Ice.LIB.SessionModSvc/Logout