Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot pass scope to request to azure to get tokens #70

Open
glebArkhipov opened this issue Aug 22, 2022 · 1 comment
Open

Cannot pass scope to request to azure to get tokens #70

glebArkhipov opened this issue Aug 22, 2022 · 1 comment

Comments

@glebArkhipov
Copy link

glebArkhipov commented Aug 22, 2022

Hello,

I have noticed that scope, that is passed through resources, is ignored
So when following command is executed,

TOKEN_azure <- get_azure_token(
                          resource = c("openid", "offline_access"),
                          tenant = tenant,
                          app = client_id,
                          password = client_secret,
                          auth_type="authorization_code",
                          authorize_args=list(redirect_uri=redirect),
                          version=2,
                          use_cache=TRUE,
                          auth_code=code
)

The request to azure, that is sent by library, does not contain field with scope
Therefore it is not possible to get refresh token, when resource contains "offline_access"

@glebArkhipov
Copy link
Author

glebArkhipov commented Aug 22, 2022

Probably, it could be fixed by changing body here https://github.com/Azure/AzureAuth/blob/master/R/classes.R#L50
to

body <- c(
  self$client,
  code=code,
  redirect_uri=redirect,
  scope=paste(self$scope, collapse = " "),
  self$token_args
)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant