Skip to content

Commit 9f1ef6f

Browse files
committed
Merge branch 'develop' of https://github.com/attdevsupport/att-html5-sdk into develop
2 parents a2ca438 + ddfa049 commit 9f1ef6f

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

sdk/server/ruby/att/services/oauth.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,19 @@ class Html5SdkApp < Sinatra::Base
1616
content_type :json # set response type
1717
scope = request.GET['scope']
1818
return_url = request.GET['returnUrl']
19+
custom_param = request.GET['custom_param']
1920
if scope.nil? or return_url.nil?
2021
return [400, { :error => "'scope' and 'returnUrl' querystring parameters must be specified" }.to_json]
2122
end
2223
encoded_scope = CGI.escape scope
2324
encoded_return_url = CGI.escape return_url
24-
callback_handler = "#{$config['localAuthServer']}/att/callback?scope=#{encoded_scope}&returnUrl=#{encoded_return_url}"
25+
callback_handler = "#{$config['localAuthServer']}/att/callback?scope=#{encoded_scope}&returnUrl=#{encoded_return_url}"
26+
2527
auther = Auth::AuthCode.new($config['apiHost'], $config['appKey'], $config['Secret'])
2628
user_auth_url = auther.generateConsentFlowUrl(:scope => [scope], :redirect => callback_handler)
29+
if !custom_param.nil? && !custom_param.to_s.empty?
30+
user_auth_url = "#{user_auth_url}&custom_param=#{custom_param}"
31+
end
2732
{:url => user_auth_url}.to_json
2833
end
2934
end

sdk/server/ruby/lib/codekit/auth/auth_code.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class AuthCode < OAuthService
2929
# do not use unless you absolutely know what you are doing (default: '/oauth/authorize')
3030
def initialize(fqdn, client_id, client_secret, opts={})
3131
super(fqdn, client_id, client_secret, opts)
32-
@auth_url = (opts[:auth_url] || '/oauth/authorize')
32+
@auth_url = (opts[:auth_url] || '/oauth/v4/authorize')
3333
@redirect = opts[:redirect]
3434
end
3535

sdk/server/ruby/lib/codekit/auth/oauth_service.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def initialize(fqdn, client_id, client_secret, opts={})
4040
@client_secret = client_secret
4141

4242
@scope = opts[:scope]
43-
@suburl = (opts[:suburl] || '/oauth/token')
43+
@suburl = (opts[:suburl] || '/oauth/v4/token')
4444
end
4545

4646
# Creates a new oauth token

0 commit comments

Comments
 (0)