sounds cool, i'll take a look
On Jan 22, 2014, at 4:41 AM, Apostolos Emmanouilidis <aemmanou(a)redhat.com> wrote:
hello,
while looking at AGJS-122 and the possibility to add an authentication adapter which is
based on Mozilla's Persona sign-in system, I was thinking of the following API:
// Construct an AeroGear.Authentication.adapters.Persona
var persona = AeroGear.Auth({
name: 'persona',
type: 'Persona',
settings: {
verificationEndpoint: "http://127.0.0.1:3000/verify"
}
}).modules.persona;
// use login to initiate the Mozilla's Persona authentication procedure. login
enables the BrowserID and generates a signed assertion which contains the user's email
address
// on assertion generation call the verification service
persona.login({
onAssertion: function ( assertion ) {
for consistency, i would probably call
this callback 'success'
// the verification API receives the assertion and the
audience (our website URL) as parameters
// for security reasons there must be an intermediate service between the client
and the verification API. the reason for which we want the intermediate service
// is that we want to ensure that the audience parameter is not hacked. I was
thinking that it is better to avoid adding the persona.verify call inside our adapter
// since this way we would force the user to create the intermediate service
according our implementation. That's why the following line exists:
persona.verify( { assertion: assertion }, { success: onSuccessVerification, error:
onFailedVerification } );
},
error: onLoginError
});
// logout
persona.logout( onLogout );
i know for the REST adapter we also have an "enroll" method, not sure if that
makes sense for this one. I haven't really looked at the Persona thing to much, just
a shiny object that i saw and created a JIRA