Wim Decorte and Steven Blackwell wrote a whitepaper on getting OAuth2 authentication working with other identity providers. See original post here: How To Extend oAuth - White Papers - FMForums.com
The file is too large to upload here, so make sure you download it from the original post.