Google 上的 OAuth2Authenticator 和 Mac 上的 FaceBook
OAuth2Authenticator with Google and FaceBook on Mac
我正在 mac 中使用 xamarin 开发一个应用程序,它需要与 Google 和 FaceBook 连接。我尝试使用 OAuth2Authenticator 使用以下代码对用户进行身份验证:
var auth = new OAuth2Authenticator (
clientId: "myId.apps.googleusercontent.com",
clientSecret: "mysecred",
scope: "document",
authorizeUrl: new Uri ("https://accounts.google.com/o/oauth2/auth"),
redirectUrl: new Uri ("myredirect:oob"),
accessTokenUrl: new Uri ("https://accounts.google.com/o/oauth2/token"),
getUsernameAsync: null
);
当我尝试使用 auth.GetUI() 方法获取 url 时,它抛出
error "WebAuthenticator not supported on this platform."
在 Mac 应用程序中是否有其他连接 Gmail 或 Facebook 的方法。
你可以选择这样的开源库https://github.com/clancey/simpleauth
或者您必须编写一些现有 MacOS 库的绑定,但这将是一个真正的痛苦。
我正在 mac 中使用 xamarin 开发一个应用程序,它需要与 Google 和 FaceBook 连接。我尝试使用 OAuth2Authenticator 使用以下代码对用户进行身份验证:
var auth = new OAuth2Authenticator (
clientId: "myId.apps.googleusercontent.com",
clientSecret: "mysecred",
scope: "document",
authorizeUrl: new Uri ("https://accounts.google.com/o/oauth2/auth"),
redirectUrl: new Uri ("myredirect:oob"),
accessTokenUrl: new Uri ("https://accounts.google.com/o/oauth2/token"),
getUsernameAsync: null
);
当我尝试使用 auth.GetUI() 方法获取 url 时,它抛出
error "WebAuthenticator not supported on this platform."
在 Mac 应用程序中是否有其他连接 Gmail 或 Facebook 的方法。
你可以选择这样的开源库https://github.com/clancey/simpleauth
或者您必须编写一些现有 MacOS 库的绑定,但这将是一个真正的痛苦。