我尝试将我的数据从rails app导出到谷歌日历,但在登录后我无法在request.env中找到'omniauth.auth'.
我使用Rails 4.0.4和Ruby 2.0.0p481
我的Gemfile
gem 'google-api-client', '~> 0.7.1', :require => 'google/api_client'
gem 'omniauth', '~> 1.2.1'
gem 'omniauth-google-oauth2', '~> 0.2.4'
Run Code Online (Sandbox Code Playgroud)
omniauth.rb
OmniAuth.config.full_host = "http://localhost:3000"
Rails.application.config.middleware.use OmniAuth::Builder do
provider :google_oauth2, 'MY_GOOGLE_CLIENT_ID', 'MY_GOOGLE_SECRET', { :access_type => 'offline', :prompt => 'consent', :approval_prompt => 'force', :scope => 'https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/calendar', :redirect_uri => 'http://localhost:3000/auth/google-oauth2/callback', }
end
Run Code Online (Sandbox Code Playgroud)
调节器
class GoogleAuthController < ApplicationController
def create
@auth = request.env['omniauth.auth'] #here not found 'omniath.auth' and @auth is nil
if @auth.nil?
flash[:danger] = "Error during connection with Google API."
redirect_to …Run Code Online (Sandbox Code Playgroud) 我正在尝试学习 Kubernetes,但当我运行时,kubectl exec控制台中总是一片混乱:
$ kubectl.exe exec pod-httpd -c cntr-httpd -- ls -l
I0630 16:45:11.161801 1136 log.go:172] (0xc0000e82c0) (0xc000280d20) Create stream
I0630 16:45:11.170797 1136 log.go:172] (0xc0000e82c0) (0xc000280d20) Stream added, broadcasting: 1
I0630 16:45:11.175797 1136 log.go:172] (0xc0000e82c0) Reply frame received for 1
I0630 16:45:11.175797 1136 log.go:172] (0xc0000e82c0) (0xc000415680) Create stream
I0630 16:45:11.176798 1136 log.go:172] (0xc0000e82c0) (0xc000415680) Stream added, broadcasting: 3
I0630 16:45:11.177804 1136 log.go:172] (0xc0000e82c0) Reply frame received for 3
I0630 16:45:11.177804 1136 log.go:172] (0xc0000e82c0) (0xc0002da0a0) Create stream
I0630 16:45:11.177804 …Run Code Online (Sandbox Code Playgroud)