标签: oauth

更新通过OmniAuth验证的用户数据

我有一个使用Omni-Auth GitHub宝石的Rails应用程序.用户帐户创建和通过GitHub登录工作完美无瑕!

这是我的用户模型:

  def self.from_omniauth(auth)
    find_by_github_uid(auth["uid"]) || create_from_omniauth(auth)
  end

  def self.create_from_omniauth(auth)
    create! do |user|
      user.github_uid = auth["uid"]
      user.github_token = auth["credentials"]["token"]
      user.username = auth["info"]["nickname"]
      user.email = auth["info"]["email"]
      user.full_name = auth["info"]["name"]
      user.gravatar_id = auth["extra"]["raw_info"]["gravatar_id"]
      user.blog_url = auth["extra"]["raw_info"]["blog"]
      user.company = auth["extra"]["raw_info"]["company"]
      user.location = auth["extra"]["raw_info"]["location"]
      user.hireable = auth["extra"]["raw_info"]["hireable"]
      user.bio = auth["extra"]["raw_info"]["bio"]
    end
  end
Run Code Online (Sandbox Code Playgroud)

但有时用户改变他们的生物或公司,或者他们想要被雇用,所以我不想删除旧帐户,我认为如果在更新帐户后及时更新它们会很好.

这样做的最佳做法是什么?如何使用现有的OmniAuth代码更新用户信息?

ruby-on-rails oauth oauth-2.0 omniauth

0
推荐指数
1
解决办法
460
查看次数

Ruby OAuth gem存储库?

我找不到托管最新版oauth gem的存储库(v 0.4.7).

我有一个pelle/oauth github存储库,它有0.4.3的主机,并且链接到所谓的最新的oauth/oauth-ruby,它已经关闭了.

我错过了什么,或者现在这个存储库是否已经离开网格?

ruby gem open-source oauth repository

0
推荐指数
1
解决办法
479
查看次数


没有名称为'google'的资源所有者(HWIOAuthBundle和FOSUserBundle集成)

我安装了HWIOAuthBundle并完成了所有内容,如下所示:https://gist.github.com/danvbe/4476697

但是当我试图去这里时我有这个错误:"/ login/google"

没有名称为"google"的资源所有者.

我和其他API有着同样的错误:yahoo,linkedin,windows_live

我不知道为什么因为我已经完成了很好的security.yml:

jms_security_extra:
secure_all_services: false
expressions: true

security:
    encoders:
        Symfony\Component\Security\Core\User\User: plaintext
        FOS\UserBundle\Model\UserInterface: sha512

role_hierarchy:
    ROLE_ADMIN:       ROLE_USER
    ROLE_SUPER_ADMIN: [ROLE_USER, ROLE_ADMIN, ROLE_ALLOWED_TO_SWITCH]

providers:
        fos_userbundle:
            id: fos_user.user_provider.username_email

firewalls:
    dev:
        pattern:  ^/(_(profiler|wdt)|css|images|js)/
        security: false

    main:
        pattern: ^/                         
        form_login:                            
            provider: fos_userbundle        
            remember_me: true                  
            csrf_provider: form.csrf_provider
            login_path: /login
            check_path: /login_check
        remember_me:
            key: %secret%                      
        anonymous: true
        logout: true                                         
        oauth:
            resource_owners:
                yahoo:              "/login/check-yahoo"
                google:             "/login/check-google"
                windows_live:       "/login/check-windows_live"
                linkedin:           "/login/check-linkedin"
            login_path:        /login
            failure_path:      /login
            oauth_user_provider:
                service: my_user_provider
        logout:
            path: /logout
            target: /
    login: …
Run Code Online (Sandbox Code Playgroud)

php oauth symfony fosuserbundle hwioauthbundle

0
推荐指数
1
解决办法
2556
查看次数

在iOS上从Yahoo获取OAuth会话句柄

我正在尝试对Yahoo Mail服务器进行OAuth身份验证,我尝试使用oauth.io和GMTOauth,但这些都没有可能获得OAuth 1.0身份验证将返回的oauth_session_handle.我真的需要这个,所以我可以刷新我的令牌.谢谢.

oauth ios yahoo-api

0
推荐指数
1
解决办法
381
查看次数

使用Google登录会替换为使用Google+登录吗?

我被要求实施与Google的登录,以便具有Gmail帐户的用户更轻松地登录。在我的研究中,我发现此时间表表明使用Google Plus实施登录是一个更好的主意。这是否意味着

1)用Google登录(没有Google Plus帐户)会消失吗?

2)没有Google Plus帐户的用户被迫使用Google身份验证系统进行新登录?

“如果您的应用通过Google+登录按钮以外的任何方式对用户进行身份验证,我们建议您将应用切换到Google+登录”

authentication oauth oauth-2.0 google-plus google-oauth

0
推荐指数
1
解决办法
186
查看次数

在本地环境之外使用时,Google Calendar V3会挂起

我正在研究Google Calendar API的.net版本的包装器.身份验证非常简单,在本地工作正常(localhost:port).

UserCredential credential = GoogleWebAuthorizationBroker.AuthorizeAsync(
               new ClientSecrets
               {
                   ClientId = "The id of my public website",
                   ClientSecret = "The secret of my public website",
               },
               new[] { CalendarService.Scope.Calendar },
               "user",
               CancellationToken.None).Result;

            // Create the service.
            var service = new CalendarService(new BaseClientService.Initializer()
            {
                HttpClientInitializer = credential
            });

return service.Events.List("primary").Execute().Items;
Run Code Online (Sandbox Code Playgroud)

但问题是,当相同的代码部署到生产环境时(当然,密码已更改),只要我尝试访问数据,应用程序就会挂起.没有例外,没有错误代码,它只是永远加载.

有没有人经历过这个?

c# asp.net oauth google-calendar-api google-api

0
推荐指数
1
解决办法
1668
查看次数

使用背景页面和内容脚本的Chrome扩展程序

我无法绕过Chrome扩展程序的结构。

我的扩展程序有两个不同的部分:

  1. 它使用后台页面通过oAuth登录,然后从oAuth整理大量数据并将其保存到chrome.storage.local

  2. 浏览网页时,它会调用来chrome.storage.local检查当前域是否与从oAuth存储的信息匹配,如果匹配,则使用[Rich Notifications API][1]

我的结构manifest.json很糟糕。

{
  "name": "API Test",
  "version": "3.1.2",
  "manifest_version": 2,
  "minimum_chrome_version": "29",
  "app": {
    "background": {
      "scripts": ["main.js"]
    }
  },
  "permissions": ["identity", "storage", "*://*/*"],
  "oauth2": {
    "client_id": "<<client_id>>",
    "scopes": [
      "https://www.googleapis.com/auth/plus.login",
      "https://www.google.com/m8/feeds",
      "https://www.googleapis.com/auth/contacts.readonly"
    ]
  },
  "content_scripts": [
    {
      "matches": ["*://*/*"],
      "js": ["domchecker.js"]
    }
  ]
}
Run Code Online (Sandbox Code Playgroud)

这样做时,我从Chrome收到以下错误:

There were warnings when trying to install this extension:
'content_scripts' is only allowed for extensions and 
legacy packaged apps, but this is …
Run Code Online (Sandbox Code Playgroud)

javascript google-chrome oauth google-chrome-extension

0
推荐指数
1
解决办法
1405
查看次数

有没有办法让Twitter4J只使用消费者密钥和密钥来验证凭证?

我正在开发一个Android应用程序,它允许用户自己配置Twitter消费者密钥和秘密(未配置访问令牌和访问令牌秘密).我想在显示登录页面之前验证如下所示的密钥和密码,但它会引发异常:

Twitter twitter = new TwitterFactory().getInstance();
twitter.setOAuthConsumer(key, secret);
        try {
            User user = twitter.verifyCredentials(); // this line throws an exception
        } catch (Exception e) {
            e.printStackTrace();
        }
Run Code Online (Sandbox Code Playgroud)

例外是:

Twitter凭据验证fails.java.lang.IllegalStateException:缺少身份验证凭据.有关详细信息,请参见 http://twitter4j.org/en/configuration.html

有没有办法验证没有访问令牌和访问令牌访问的消费者密钥和密钥?

oauth twitter4j twitter-oauth

0
推荐指数
1
解决办法
779
查看次数

facebook登录使用firebase in ionic

在使用firebase进入我的离子应用程序登录facebook后,我面临着收到电子邮件和用户喜欢的问题.在获得Facebook显示名称和用户中的一些其他信息后,没有被重定向到仪表板页面而是登录页面得到刷新.虽然我在stackoverflow和其他的sorces上阅读不同的帖子,但我被卡住了.请帮我解决这两个问题.**1)**如何获取用户的电子邮件和喜欢**2)**如何通过Facebook验证后很快将用户重定向到仪表板..这是代码

****Controller:****

$scope.loginFaceBook = function() {
        ///alert('fb Login firebase...');
        var existingAuthData = Auth.$getAuth();
        console.log("existingAuthData : ",existingAuthData);
        //console.log("existingAuthData Email : ",existingAuthData.thirdPartyUserData.email);
       Auth.$authWithOAuthRedirect("facebook").then(function(authData) {
            alert('done 1');
      // User successfully logged in
           console.log(authData);
           $location.path('app/Dash');
    }, {
  remember: "sessionOnly",
  scope: "email,user_likes"
}).catch(function(error) {
      if (error.code === "TRANSPORT_UNAVAILABLE") {
        Auth.$authWithOAuthPopup("facebook").then(function(authData) {
          // User successfully logged in. We can log to the console
          // since we’re using a popup here
            alert('done 2');
          console.log(authData);
        $location.path('app/Dash');
        }, {
  remember: "sessionOnly",
  scope: "email,user_likes"
});
      } else {
        // Another …
Run Code Online (Sandbox Code Playgroud)

facebook oauth angularjs firebase ionic-framework

0
推荐指数
1
解决办法
584
查看次数