Skip to content

Instantly share code, notes, and snippets.

@kickroot
Created February 13, 2013 20:47
Show Gist options
  • Select an option

  • Save kickroot/4948100 to your computer and use it in GitHub Desktop.

Select an option

Save kickroot/4948100 to your computer and use it in GitHub Desktop.
Grails authentication via API key, Authentication implmentation.
package com.mycompany
import org.springframework.security.*
import org.springframework.security.core.*
class ApiTokenAuthentication implements Authentication {
///////////////////////////// Class Attributes \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
////////////////////////////// Class Methods \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
//////////////////////////////// Attributes \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
String name
Set authorities
Object credentials
Object details
Object principal
boolean authenticated
/////////////////////////////// Constructors \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
////////////////////////////////// Methods \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
//------------------------ Implements: Authentication
public Set<GrantedAuthority> getAuthorities() {
return authorities;
}
//------------------------ Overrides:
//---------------------------- Abstract Methods -----------------------------
//---------------------------- Utility Methods ------------------------------
//---------------------------- Property Methods -----------------------------
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment