Skip to content

Commit b6a081f

Browse files
committed
Merge remote-tracking branch 'dan-nl/feature/readme-strategy-options' jaredhanson#93
2 parents 2aff790 + a8cda94 commit b6a081f

File tree

1 file changed

+76
-0
lines changed

1 file changed

+76
-0
lines changed

README.md

+76
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,82 @@ app.get('/auth/example/callback',
7575
});
7676
```
7777

78+
## Strategy Options
79+
80+
#### authorizationURL
81+
REQUIRED<br>
82+
`{ authorizationURL: string }`<br>
83+
URL used to obtain an authorization grant
84+
85+
#### tokenURL
86+
REQUIRED<br>
87+
`{ tokenURL: string }`<br>
88+
URL used to obtain an access token
89+
90+
#### clientID
91+
REQUIRED<br>
92+
`{ clientID: string }`<br>
93+
The client identifier issued to the client by the OAuth 2.0 service.
94+
95+
#### clientSecret
96+
REQUIRED<br>
97+
`{ clientSecret: string }`<br>
98+
The client secret issued to the client by the OAuth 2.0 service.
99+
100+
#### callbackURL
101+
OPTIONAL<br>
102+
`{ callbackURL: string }`<br>
103+
URL to which the service provider will redirect the user after obtaining authorization. The URL can be relative or fully qualified; when relative, the original URL of the authorization request will be prepended to the relative URL.
104+
105+
#### customHeaders
106+
OPTIONAL<br>
107+
`{ customHeaders: Object }`<br>
108+
Custom headers you can pass along with the authorization request.
109+
110+
#### passReqToCallback
111+
OPTIONAL<br>
112+
`{ passReqToCallback: boolean }`<br>
113+
When set to `true`, the first argument sent to the verify callback is the request, `http.IncomingMessage`, (default: `false`)
114+
115+
#### proxy
116+
OPTIONAL<br>
117+
`{ proxy: boolean }`<br>
118+
Used when resolving a relative callbackURL. When set to `true`, `req.headers['x-forwarded-proto']` and `req.headers['x-forwarded-host']` will be used otherwise `req.connection.encrypted` and `req.headers.host` will be used.
119+
120+
_Note_: if your webserver, e.g. `Express`, provides `req.app.get` and the value `req.app.get('trust proxy')` is set, proxy option will automatically be set to `true`.
121+
122+
#### scope
123+
OPTIONAL<br>
124+
`{ scope: Array|string }`<br>
125+
The scope of the access request made by the client of the OAuth 2.0 service. The scope is a list one or more strings, which are defined by the OAuth 2.0 service.
126+
127+
When the scope is provided as a list of strings, each string should be separated by a single space, as per the OAuth 2.0 spec. When the scope is provided as an Array of strings, each array element will be joined by the scopeSeparator.
128+
129+
#### scopeSeparator
130+
OPTIONAL<br>
131+
`{ scopeSeparator: string }`<br>
132+
The separator used to join the scope strings when the `scope` is provided as an Array (default: `single space`).
133+
134+
#### sessionKey
135+
OPTIONAL<br>
136+
`{ sessionKey: string }`<br>
137+
The key to use to store the state string when the `state` option is set to `true`. (default: 'oauth2:' + url.parse(options.authorizationURL).hostname)
138+
139+
#### skipUserProfile
140+
OPTIONAL<br>
141+
`{ skipUserProfile: boolean }`<br>
142+
Whether or not to return the user profile information of the user granting authorization to their account information.
143+
144+
#### state
145+
OPTIONAL<br>
146+
`{ state: boolean }`<br>
147+
When set to `true`, a state string with be created, stored, sent along with the authentication request and verified when the response from the OAuth 2.0 service is received.
148+
149+
#### store
150+
OPTIONAL<br>
151+
`{ store: Function }`<br>
152+
The store to use when storing the state string (default: `SessionStore`, `req.session[sessionKey]`, requires session middleware such as `express-session`). See the [NullStore](lib/state/null.js) for an example of a store function.
153+
78154
## Contributing
79155

80156
#### Tests

0 commit comments

Comments
 (0)