GithubHelp home page GithubHelp logo

Comments (8)

casbin-bot avatar casbin-bot commented on July 20, 2024

@tangyang9464 @JalinWang @imp2002

from casdoor.

hsluoyz avatar hsluoyz commented on July 20, 2024

@lajoll1 can you provide more details? Like what SAML field should be provided? In what format? It's better to not require us to setup a Nextcloud instance by ourselves

from casdoor.

lajoll1 avatar lajoll1 commented on July 20, 2024

Ok, i'll try giving some more details.
So, on the nextcloud side, you've got these parameters.
Capture d’écran 2024-03-07 à 18 28 23

If on casdoor's side, I add a custom fixed string attribute (let's say named "Group", with value Group1)
Capture d’écran 2024-03-07 à 18 45 03
and set in nextcloud's field the attribute Group in the appropriate field, as in the following screenshot:

Capture d’écran 2024-03-07 à 18 31 24 All the users who login will get the attribute Group1 and therefore the appropriate permissions. Example below for Alice. Capture d’écran 2024-03-07 à 18 33 33 I would like to transmit all the groups to which the user belongs to in casdoor in nextcloud through SAML attribute. For instance if under casdoor i've got two users, Alice. Alice belongs to groups group1 and group2. When Alice signs in, nextcloud, in addition to mail/email..., should receive groups group1 and group2. Regarding the data format, could not find accurate data on the doc of the SSO module for nextcloud. But from what I read so far, I feel like the following format is expected
<Attribute Name="Group">
        <AttributeValue>Group1</AttributeValue>
        <AttributeValue>Group2</AttributeValue>
    </Attribute>

Does that answer your question ?

from casdoor.

hsluoyz avatar hsluoyz commented on July 20, 2024

@lajoll1 what about using the similar format like Roles? Can you check if the format is OK? If OK, we will add Groups similarly.

casdoor/object/saml_idp.go

Lines 113 to 123 in c532a5d

roles := attributes.CreateElement("saml:Attribute")
roles.CreateAttr("Name", "Roles")
roles.CreateAttr("NameFormat", "urn:oasis:names:tc:SAML:2.0:attrname-format:basic")
err := ExtendUserWithRolesAndPermissions(user)
if err != nil {
return nil, err
}
for _, role := range user.Roles {
roles.CreateElement("saml:AttributeValue").CreateAttr("xsi:type", "xs:string").Element().SetText(role.Name)
}

from casdoor.

lajoll1 avatar lajoll1 commented on July 20, 2024

Indeed! Feel like it might work.
Created a fake role.
I can't see the "Roles" attribute in the SAML metadata in the created application.
How can I test it ?
Thanks for your help

from casdoor.

hsluoyz avatar hsluoyz commented on July 20, 2024

@lajoll1 debug it, make sure getPermissionsAndRolesByUser() returns non-empty roles

from casdoor.

lajoll1 avatar lajoll1 commented on July 20, 2024

Sorry my question might look stupid but i'm not a dev and never worked with Go.
How am I supposed to call the function in that case ?

from casdoor.

hsluoyz avatar hsluoyz commented on July 20, 2024

Already has this feature

from casdoor.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.