Skip to content

Commit

Permalink
auth doc tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
jgravois committed Oct 9, 2018
1 parent 6ab6b87 commit fc2e99a
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 20 deletions.
2 changes: 1 addition & 1 deletion docs/src/guides/browser-authentication.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ group: 2-authentication

# Authentication in Browser-based Apps

In the [Node.js](../node/) guide we explained how to instantiate an [`ApplicationSession`](/arcgis-rest-js/api/auth/ApplicationSession/) with hardcoded credentials. In the browser, you need to use [OAuth 2.0](https://developers.arcgis.com/documentation/core-concepts/security-and-authentication/signing-in-arcgis-online-users/) and have users can sign directly into [ArcGIS Online](https://www.arcgis.com) or ArcGIS Enterprise.
In the [Node.js](/arcgis-rest-js/node/) guide we explained how to instantiate an [`ApplicationSession`](/arcgis-rest-js/api/auth/ApplicationSession/) with hardcoded credentials. In the browser, you need to use [OAuth 2.0](https://developers.arcgis.com/documentation/core-concepts/security-and-authentication/signing-in-arcgis-online-users/) and have users sign directly into [ArcGIS Online](https://www.arcgis.com) or ArcGIS Enterprise.

![browser based login](https://developers.arcgis.com/documentation/core-concepts/security-and-authentication/images/authorization-screen.png)

Expand Down
2 changes: 1 addition & 1 deletion docs/src/guides/node.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ group: 1-get-started

# Get Started with Node.js

Make sure you have polyfills for [`fetch`](https://github.com/matthew-andrews/isomorphic-fetch) and [`FormData`](https://github.com/form-data/isomorphic-form-data) installed before using any ArcGIS REST JS library. You can find `npm install` commands for all packages in the [API reference](../../api).
Make sure you have polyfills for [`fetch`](https://github.com/matthew-andrews/isomorphic-fetch) and [`FormData`](https://github.com/form-data/isomorphic-form-data) installed before using any ArcGIS REST JS library. You can find `npm install` commands for all packages in the [API reference](/arcgis-rest-js/api).

```bash
npm install @esri/arcgis-rest-request isomorphic-fetch isomorphic-form-data
Expand Down
18 changes: 9 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 3 additions & 4 deletions packages/arcgis-rest-auth/src/ApplicationSession.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,11 @@ export interface IApplicationSessionOptions {
* ```js
* // visit https://developers.arcgis.com to generate your own clientid and secret
* const session = new ApplicationSession({
* clientId,
* clientSecret
* clientId: "abc123",
* clientSecret: "sshhhhhh"
* })
* ```
* You can use [App Login](https://developers.arcgis.com/documentation/core-concepts/security-and-authentication/accessing-arcgis-online-services/) to access premium content and services in ArcGIS Online.
* in `request`.
* You can use [App Login](/arcgis-rest-/js/guides/node/) to access premium content and services in ArcGIS Online.
*
*/
export class ApplicationSession implements IAuthenticationManager {
Expand Down
13 changes: 9 additions & 4 deletions packages/arcgis-rest-auth/src/UserSession.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,15 +188,20 @@ export interface IUserSessionOptions {

/**
* ```js
* // OAuth 2.0 allows users to sign in directly to arcgis.com or ArcGIS Enterprise
* UserSession.beginOAuth2({
* // register a new app to create a unique clientId
* clientId: "abc123",
* redirectUri: 'https://yourapp.com/authenticate.html'
* })
* .then(session)
* // or
* const session = new UserSession({
* username: "jsmith",
* password: "123456"
* })
* ```
* Used to manage the authentication of ArcGIS Online and ArcGIS Enterprise users
* in `request`. This class also includes several
* helper methods for authenticating users with [OAuth 2.0](https://developers.arcgis.com/documentation/core-concepts/security-and-authentication/browser-based-user-logins/) in both browser and
* server applications.
* Used to authenticate both ArcGIS Online and ArcGIS Enterprise users. `UserSession` includes helper methods for [OAuth 2.0](/arcgis-rest-js/guides/browser-authentication/) in both browser and server applications.
*
*/
export class UserSession implements IAuthenticationManager {
Expand Down
2 changes: 1 addition & 1 deletion packages/arcgis-rest-geocoder/src/suggest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export interface ISuggestResponse {
}

/**
* Used to return a placename [suggestion]((https://developers.arcgis.com/rest/geocode/api-reference/geocoding-suggest.htm) for a partial string.
* Used to return a placename [suggestion](https://developers.arcgis.com/rest/geocode/api-reference/geocoding-suggest.htm) for a partial string.
*
* ```js
* import { suggest } from '@esri/arcgis-rest-geocoder';
Expand Down

0 comments on commit fc2e99a

Please sign in to comment.