GithubHelp home page GithubHelp logo

Comments (6)

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

@tangyang9464 @JalinWang @imp2002

from casdoor.

hsluoyz avatar hsluoyz commented on July 20, 2024

@DevOpserzhao Casdoor already defined some built-in attributes like Name, Email, DisplayName, etc. You should not add them again in the "SAML attributes" table in application edit page like: https://door.casdoor.com/applications/built-in/app-built-in#:~:text=POST%20binding%20%3A-,SAML%20attributes,-%3A

image

Built-in attributes:

casdoor/object/saml_idp.go

Lines 91 to 104 in c532a5d

email := attributes.CreateElement("saml:Attribute")
email.CreateAttr("Name", "Email")
email.CreateAttr("NameFormat", "urn:oasis:names:tc:SAML:2.0:attrname-format:basic")
email.CreateElement("saml:AttributeValue").CreateAttr("xsi:type", "xs:string").Element().SetText(user.Email)
name := attributes.CreateElement("saml:Attribute")
name.CreateAttr("Name", "Name")
name.CreateAttr("NameFormat", "urn:oasis:names:tc:SAML:2.0:attrname-format:basic")
name.CreateElement("saml:AttributeValue").CreateAttr("xsi:type", "xs:string").Element().SetText(user.Name)
displayName := attributes.CreateElement("saml:Attribute")
displayName.CreateAttr("Name", "DisplayName")
displayName.CreateAttr("NameFormat", "urn:oasis:names:tc:SAML:2.0:attrname-format:basic")
displayName.CreateElement("saml:AttributeValue").CreateAttr("xsi:type", "xs:string").Element().SetText(user.DisplayName)

from casdoor.

DevOpserzhao avatar DevOpserzhao commented on July 20, 2024
image

from casdoor.

DevOpserzhao avatar DevOpserzhao commented on July 20, 2024

I have changed the code to fix it

from casdoor.

hsluoyz avatar hsluoyz commented on July 20, 2024

@DevOpserzhao can you make a PR to share your code?

from casdoor.

DevOpserzhao avatar DevOpserzhao commented on July 20, 2024

@DevOpserzhao can you make a PR to share your code?

sure, My local environment
GOARCH='arm64'
GOVERSION='go1.22.1'

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.