Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def initialize(vars)

# Adds the Authorization header, if possible
def authenticate(headers)
headers["Authorization"] = "Bearer #{@token_manager.access_token}"
headers["Authorization"] = "Bearer #{@token_manager.token}"
end

# Checks if all the inputs needed are present
Expand Down
2 changes: 1 addition & 1 deletion lib/ibm_cloud_sdk_core/authenticators/iam_authenticator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def initialize(vars)
end

def authenticate(headers)
headers["Authorization"] = "Bearer #{@token_manager.access_token}"
headers["Authorization"] = "Bearer #{@token_manager.token}"
end

def validate
Expand Down
8 changes: 4 additions & 4 deletions test/unit/test_iam_token_manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ def test_request_token
"iss": "sss",
"aud": "sss",
"uid": "sss",
"iat": Time.now.to_i + 3600,
"exp": Time.now.to_i
"iat": Time.now.to_i,
"exp": Time.now.to_i + 3600
}
token = JWT.encode token_layout, "secret", "HS256"
response = {
Expand Down Expand Up @@ -108,8 +108,8 @@ def test_get_token
"iss" => "sss",
"aud" => "sss",
"uid" => "sss",
"iat" => 3600,
"exp" => Time.now.to_i
"iat" => Time.now.to_i,
"exp" => Time.now.to_i + 3600
}

access_token = JWT.encode(access_token_layout, "secret", "HS256", "kid": "230498151c214b788dd97f22b85410a5")
Expand Down