-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathAuthUrlBuilder.java
More file actions
62 lines (55 loc) · 1.67 KB
/
AuthUrlBuilder.java
File metadata and controls
62 lines (55 loc) · 1.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
package org.scribe.builder;
/**
* Encapsulation for the Authorization url to cope with the weakness of the oauth2 spec.
*/
public interface AuthUrlBuilder {
/**
* The base url of the provider we should be redirecting the client to.
*
* @param endpoint provider endpoint url
* @return builder instance
*/
AuthUrlBuilder setEndpoint(String endpoint);
/**
* Your client id for this provider.
*
* @param clientId providers client id
* @return builder instance
*/
AuthUrlBuilder setClientId(String clientId);
/**
* Redirect/Callback url the provider should go after successful authorization.
*
* @param redirectUrl redirect url
* @return builder instance
*/
AuthUrlBuilder setRedirectUrl(String redirectUrl);
/**
* Optional scopes to request for authorization.
*
* @param scope consult provider documentation for specifics on how these should be formatted
* @return builder instance
*/
AuthUrlBuilder setScope(String scope);
/**
* Optional state parameter that the provider will send as part of the response.
* helps to protect against csrf attacks
*
* @param state random state
* @return builder instance
*/
AuthUrlBuilder setState(String state);
/**
* Optional response type, has no default, if none is provided it will not be part of the url.
*
* @param responseType format of the authorization response
* @return builder instance
*/
AuthUrlBuilder setResponseType(String responseType);
/**
* The final authorization url.
*
* @return constructed url
*/
String build();
}