fixed ci4s oauth2接入
This commit is contained in:
parent
c0da80139a
commit
d038f30994
|
@ -2,6 +2,10 @@ class Oauth::Ci4sController < Oauth::BaseController
|
||||||
include RegisterHelper
|
include RegisterHelper
|
||||||
|
|
||||||
|
|
||||||
|
def oauth_url
|
||||||
|
Ci4s::Service.oauth_url(code)
|
||||||
|
end
|
||||||
|
|
||||||
# 需要educoder那边设置回调地址
|
# 需要educoder那边设置回调地址
|
||||||
def create
|
def create
|
||||||
begin
|
begin
|
||||||
|
|
|
@ -23,6 +23,9 @@ module Ci4s::Service
|
||||||
config.dig("oauth", "ci4s", "redirect_uri")
|
config.dig("oauth", "ci4s", "redirect_uri")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def oauth_url
|
||||||
|
"#{base_url}/oauth/authorize?client_id=#{client_id}&redirect_uri=#{URI.encode_www_form_component(redirect_uri)}&response_type=code&grant_type=authorization_code"
|
||||||
|
end
|
||||||
|
|
||||||
def request(method, url, params)
|
def request(method, url, params)
|
||||||
begin
|
begin
|
||||||
|
|
|
@ -26,6 +26,7 @@ Rails.application.routes.draw do
|
||||||
get 'auth/failure', to: 'oauth/base#auth_failure'
|
get 'auth/failure', to: 'oauth/base#auth_failure'
|
||||||
get 'auth/cas/callback', to: 'oauth/cas#create'
|
get 'auth/cas/callback', to: 'oauth/cas#create'
|
||||||
get 'auth/acge/callback', to: "oauth/acge#create"
|
get 'auth/acge/callback', to: "oauth/acge#create"
|
||||||
|
get 'oauth_ci4s', to: "oauth/ci4s#oauth_url"
|
||||||
get 'auth/ci4s/callback', to: "oauth/ci4s#create"
|
get 'auth/ci4s/callback', to: "oauth/ci4s#create"
|
||||||
get 'auth/acge/refer', to: "oauth/acge#refer"
|
get 'auth/acge/refer', to: "oauth/acge#refer"
|
||||||
get 'auth/:provider/callback', to: 'oauth/callbacks#create'
|
get 'auth/:provider/callback', to: 'oauth/callbacks#create'
|
||||||
|
|
Loading…
Reference in New Issue