litesaml / lightsaml

MIT License
82 stars 23 forks source link

How to define attribute that service provider expects, in xml metadata #57

Open fpetrovic opened 1 year ago

fpetrovic commented 1 year ago

I went over docs and repo. I could not find the way to add expected "role" attribute that is required by my service provider. In metadata, I defined:

but can't find the way to attach the role attribute that should be required.

JasonEleventeen commented 1 year ago

Hoping you have found an answer im looking into this as well it appears like this should work?

$assertion->addItem(
                (new AttributeStatement())
                    ->addAttribute(new Attribute(
                        ClaimTypes::EMAIL_ADDRESS,
                        $userEmail
                    ))
                    ->addAttribute(new Attribute(
                        'NAME',
                        'VALUE'
                    ))
            )