I have an IhybridRealm implementation as below. AT first everything is OK, the user is autheticated, all the attributes get their correct value. Everybody happy.
But when I add
class auth.PasoeAuth implements IHybridRealm:
method public character GetAttribute(cUserid as integer, attrName as character):
define variable attrValue as character no-undo.
case attrName:
when 'ATTR_ROLES' then attrValue = 'PSCUser'.
when 'ATTR_ENABLED' then attrValue = 'T'.
when 'ATTR_LOCKED' then attrValue = 'F'.
when 'ATTR_EXPIRED' then attrValue = 'F'.
when 'test2' then attrValue = 'hatsekidee!'.
end case.
message attrName '=' attrValue.
return attrValue.
end method.
/* ... */
end class.Sorry about the cryptic title, I pressed send too fast. If I alter my post it will probably gone, so I just leave it like this...
Fixed it. Deep down the documentation is stated that the custom attributes defined in OERealm.UserDetails.propertiesAttrName should contain JSON. No clue why this is a good idea...
bottom line:
when 'test2' then attrValue = '~{ "value": "hatsekidee!"}'.
is what it should be. Then on the appserver code you have to do a hcp:get-property('test2') and parse the JSON. It seems a bit over complicated to me.