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

OneDrive driver CI Loop #38

Open
kylemann16 opened this issue Jun 1, 2020 · 0 comments
Open

OneDrive driver CI Loop #38

kylemann16 opened this issue Jun 1, 2020 · 0 comments

Comments

@kylemann16
Copy link

Write tests against arbiter onedrive driver in order to keep it up to date. This test requires browser interaction, so might not be doable with pure scripting.

You will need these variables satisfied:
client_id, tenant_id, redirect_uri, base_url, client_secret, grant_type, and scope="offline_access%20files.read.all%20user.read.all".
The query grant_type will be authorization_code in the first step, and in the refresh step will be refresh_token.

This test will need to hit https://login.microsoftonline.com/common/oauth2/v2.0/authorize with the variables above in the query parameters. This will allow a user to authenticate via oauth with microsoft. Once you've logged in you will be redirected to the url ${redirect_uri}?code=xxxxyyyy&state=12345. Take the code from this url and use it in the next step.

Next you will use that code as the query param code and will hit https://login.microsoftonline.com/common/oauth2/v2.0/token. All other params stay the same. This will return a json response with a refresh_token and access_token key. Parse these two into their own variables and continue.

To refresh you will hit https://login.microsoftonline.com/common/oauth2/v2.0/token, but with the addition of access_token, refresh_token, and grant_type=refresh_token. This will provide the same json response, with access_token and refresh_token keys.

If at any point you have access_token and refresh_token, you can use these config for the onedrive driver. The config must be

 "onedrive": {
    "access_token": xxxx, 
    "refresh_token": yyyy,
    "client_id": zzzz,
    "redirect_uri": aaaa,
    "client_secret": bbbb,
    "tenant_id": cccc
  }
}
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