src/main/java/com/github/jreddit/oauth/RedditOAuthAgent.java
public synchronized String generateCodeFlowURI(RedditScopeBuilder scopeBuilder, RedditDuration duration) {
        
        // Set parameters
        Map<String, String> params = new HashMap<String, String>();
        params.put(PARAM_CLIENT_ID, redditApp.getClientID());
        params.put(PARAM_RESPONSE_TYPE, "code");
        params.put(PARAM_STATE, UUID.randomUUID().toString());
        params.put(PARAM_REDIRECT_URI, redditApp.getRedirectURI());
        params.put(PARAM_DURATION, duration.value());
        params.put(PARAM_SCOPE, scopeBuilder.build());
        
        // Create URI
        return REDDIT_AUTHORIZE + KeyValueFormatter.format(params, true);
        
    }
public synchronized String generateCodeFlowURI(RedditScopeBuilder scopeBuilder, RedditDuration duration) {
        
        // Set parameters
        Map<String, String> params = new HashMap<String, String>();
        params.put(PARAM_CLIENT_ID, redditApp.getClientID());
        params.put(PARAM_RESPONSE_TYPE, "code");
        params.put(PARAM_STATE, UUID.randomUUID().toString());
        params.put(PARAM_REDIRECT_URI, redditApp.getRedirectURI());
        params.put(PARAM_DURATION, duration.value());
        params.put(PARAM_SCOPE, scopeBuilder.build());
        
        // Create URI
        return REDDIT_AUTHORIZE + KeyValueFormatter.format(params, true);
        
    }
Generate the <i>code flow</i> Uniform Resource Locator (URI) for a
reddit user to authorize your application.<br>
<br>
The user will, after authorization, receive a <i>code</i>. This can be turned into
a <i>RedditToken</i> using {@link #token(String)}.

@param scopeBuilder Authorization scope builder (must not be <i>null</i>)
@param duration Duration that the token can last

@return The URI users need to visit and retrieve the <i>code</i> from

@see {@link #token(String)} for converting the <i>code</i> into a usable <i>RedditToken</i>