Custom Providers
// this can be anywhere but we will say it is in models/CustomProvider.cfc
component implements="cbsso.models.ISSOIntegrationProvider" accessors=true {
// custom properties you need
property name="clientId";
property name="clientSecret";
// The name of your provider
// this will be used to construct the redirect URI
// in this case it will be /cbsso/auth/CustomProvider
public string function getName(){
return "CustomProvider";
}
// Return the icon url for easy rendering.
// This can return an empty string if you don't use the
// auto icon rendering feature of the ProviderService.
public string function getIconURL(){
return "";
}
// Return the auth endpoint URL of your identity provider.
public string function startAuthenticationWorflow( required any event ){
return "http://someidentityprovider.com/oauth/signin";
}
// This function will be called when the identity provider responds.
// You should process the request from the IP and return a
// properly configured instance of SSOAuthorizationResponse.
public any function processAuthorizationEvent( required any event ){
var authResponse = wirebox.getInstance( "SSOAuthorizationResponse@cbsso" );
return authResponse.setWasSuccessful( true )
.setFirstName( event.getValue( "firstName" ) )
.setEmail( event.getValue( "email" ) );
}
}Last updated
Was this helpful?