I have found this https://github.com/twocanoes/psso-server-go which gives a good understanding on the things needed on the IdP server side. Also the Apple documentation like https://developer.apple.com/documentation/authenticationservices/registering-devices-and-users and other related articles gives a rough idea around the IdP side implementation