There are some works on dashboard-side preparations. Please check the official docs for that.
Implementation on the iOS side
Add this ‘MyAuthorizationAppleIDButton.swift’ into your sources tree.
Place a normal button and set the class
Build up your login view controller
And this is code to sign out
You may need this block in another view controller.
It is some case-depending sources just for my case, if you faced any error, remove or replace by fitting to your case.