Skip to content

Instantly share code, notes, and snippets.

@wendelicious
Created September 14, 2016 17:41
Show Gist options
  • Save wendelicious/ca8ac2fc28edd65b8f1f954f462414b5 to your computer and use it in GitHub Desktop.
Save wendelicious/ca8ac2fc28edd65b8f1f954f462414b5 to your computer and use it in GitHub Desktop.
Auth token fluent configuration
public static ServletModule infusionsoftIdApplication(String... anonymousPaths) {
final String[] antPaths;
if (null == anonymousPaths) {
antPaths = new String[0];
} else {
antPaths = anonymousPaths;
}
final InfusionsoftIdCasAuthenticator casAuthenticator = new InfusionsoftIdCasAuthenticator();
return module()
.authenticatedByDefault()
.anonymous(antPaths)
.allowSwaggerSpec()
.and()
.authToken(casAuthenticator).asAuthorizationBearerTokenHeader()
.authToken(casAuthenticator).asParameter("_authToken")
.build();
}
@wendelicious
Copy link
Author

This makes me think I want to change how I build the JWT garbage to follow authToken(jwtAuthenticator).asJwt() or something.

@acourtneybrown
Copy link

what about:

.authToken(casAuthenticator)
  .asAuthorizationBearerTokenHeader()
  .asParameter("_authToken")

??

@wendelicious
Copy link
Author

wendelicious commented Sep 14, 2016

<mumble> ... This is where I started ... reasons ... </mumble>

I'll look into it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment