Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.

Commit 8bf2658

Browse files
Merge pull request #6 from francescm/master
Let Usage example to work. @francescm, thank you for your contribution.
2 parents a021f28 + 68cd5f0 commit 8bf2658

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,11 @@ tenant = 'tenant.onmicrosoft.com'
4040
user_cred = ADAL::UserCredential.new(username, password)
4141
client_cred = ADAL::ClientCredential.new(client_id, client_secret)
4242
context = ADAL::AuthenticationContext.new(ADAL::Authority::WORLD_WIDE_AUTHORITY, tenant)
43+
resource = "https://graph.microsoft.com"
4344
tokens = context.acquire_token_for_user(resource, client_cred, user_cred)
4445

4546
# add the access token to the request header
46-
callback = Proc.new { |r| r.headers["Authorization"] = "Bearer #{tokens.access_token}"
47+
callback = Proc.new { |r| r.headers["Authorization"] = "Bearer #{tokens.access_token}" }
4748

4849
graph = MicrosoftGraph.new(
4950
base_url: "https://graph.microsoft.com/v1.0",

0 commit comments

Comments
 (0)