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

Improving dialog-based acquireToken javadocs #1268

Merged
merged 3 commits into from
Sep 4, 2018
Merged
Changes from 1 commit
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 @@ -560,14 +560,16 @@ && checkADFSValidationRequirements(loginHint, callback)) {
}

/**
* This uses new dialog based prompt. It will create a handler to run the
* dialog related code. It will start interactive flow if needed. It checks
* the cache to return existing result if not expired. It tries to use
* refresh token if available. If it fails to get token with refresh token,
* behavior will depend on options. If promptbehavior is AUTO, it will
* remove this refresh token from cache and fall back on the UI. Default is
* AUTO.
*
* acquireToken will authorize an end user to call the specified resource.
* The minted access token will be sent to the {@link AuthenticationCallback}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note about clarity: "minted" may confuse users into thinking that our library creates access tokens when, in reality, they are given to us.

How about:

  • "The access token returned from the STS..."
  • "The acquired access token...."
  • "The access token"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call out. Fixed.

* and can be used to call the specified protected resource.
* By default, acquireToken will attempt to fulfill the request silently, and
* perform an interactive login if needed or explicitly specified in
* the request. This overload uses an
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are two-spaces after the period in the javadoc. Just a formatting thing.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bad habit :)

* [AlertDialog](https://developer.android.com/guide/topics/ui/dialogs)
* in cases UI is required. This overload does not support any flow
danieldobalian marked this conversation as resolved.
Show resolved Hide resolved
* requiring a
* [token broker](https://github.com/AzureAD/azure-activedirectory-library-for-android/wiki/Broker).
* @param resource required resource identifier.
* @param clientId required client identifier.
* @param redirectUri Optional. It will use packagename and provided suffix
Expand Down Expand Up @@ -602,9 +604,15 @@ && checkADFSValidationRequirements(loginHint, callback)) {
}

/**
* acquireToken will start an interactive auth flow to acquire new tokens
* with the requested claims. Bypasses token cache if promptbehavior is not AUTO or claims are passed. This overload uses new dialog based prompt.
* It will create a handler to run the dialog related code.
* acquireToken will authorize an end user to call the specified resource.
* The minted access token will be sent to the {@link AuthenticationCallback}
danieldobalian marked this conversation as resolved.
Show resolved Hide resolved
* and can be used to call the specified protected resource.
* Bypasses token cache if @param prompt is not AUTO or claims are passed.
* This overload uses an
* [AlertDialog](https://developer.android.com/guide/topics/ui/dialogs)
* in cases UI is required. This overload does not support any flow
danieldobalian marked this conversation as resolved.
Show resolved Hide resolved
danieldobalian marked this conversation as resolved.
Show resolved Hide resolved
* requiring a
* [token broker](https://github.com/AzureAD/azure-activedirectory-library-for-android/wiki/Broker).
*
* @param resource required resource identifier.
* @param clientId required client identifier.
Expand Down