feat: assign users to teams via OIDC claims #1393
|
@ -57,20 +57,20 @@ You should see "(sso: *your_oidcID*)" written next to each team you were asigned
|
|||
|
||||
viehlieb marked this conversation as resolved
Outdated
|
||||
*All examples assume one team called "team 1"*
|
||||
|
||||
viehlieb marked this conversation as resolved
Outdated
konrad
commented
What kind of behaviour? Please rename it to something more specific. And please don't capitalize the heading, same for the other headings. What kind of behaviour? Please rename it to something more specific.
And please don't capitalize the heading, same for the other headings.
|
||||
1. *Token delivers team.name +team.oidc_id and Vikunja team does not exist:* \
|
||||
New team will be created called "team 1" with attribute oidcId: "33929"
|
||||
1. *Token delivers team.name +team.oidcID and Vikunja team does not exist:* \
|
||||
New team will be created called "team 1" with attribute oidcID: "33929"
|
||||
|
||||
|
||||
2. *In Vikunja Team with name "team 1" already exists in vikunja, but has no oidcID set:* \
|
||||
viehlieb marked this conversation as resolved
Outdated
konrad
commented
Is the attribute called Is the attribute called `oidcId` or `oidcID`? The Authentik example was using `oidcId`.
viehlieb
commented
in authentik it is called in migration:
Therefore in the db it is called oidc_id I agree, there is an inconsistency in the .md file. I try to fit the naming to the context. in authentik it is called `oidcID`
in migration:
```
type teams20230104152903 struct {
OidcID string `xorm:"varchar(250) null" maxLength:"250" json:"oidc_id"`
}
```
Therefore in the db it is called oidc_id
I agree, there is an inconsistency in the .md file.
I try to fit the naming to the context.
Do you have suggested changes in renaming?
konrad
commented
I think the name is fine, but please use the same one everywhere. I think the name is fine, but please use the same one everywhere.
|
||||
new team will be created called "team 1" with attribute oidc_id: "33929"
|
||||
new team will be created called "team 1" with attribute oidcID: "33929"
|
||||
|
||||
|
||||
3. *In Vikunja Team with name "team 1" already exists in vikunja, but has different oidcID set:* \
|
||||
new team will be created called "team 1" with attribute oidcId: "33929"
|
||||
new team will be created called "team 1" with attribute oidcID: "33929"
|
||||
|
||||
|
||||
4. *In Vikunja Team with oidcID "33929" already exists in vikunja, but has different name than "team1":* \
|
||||
new team will be created called "team 1" with attribute oidcId: "33929"
|
||||
new team will be created called "team 1" with attribute oidcID: "33929"
|
||||
|
||||
|
||||
5. *Scope vikunja_scope is not set:* \
|
||||
|
|
|
@ -136,8 +136,6 @@ func GetTeamByOidcIDAndName(s *xorm.Session, oidcID string, teamName string) (*T
|
|||
has, err := s.
|
||||
Table("teams").
|
||||
Where("oidc_id = ? AND name = ?", oidcID, teamName).
|
||||
Asc("id").
|
||||
Limit(1).
|
||||
Get(team)
|
||||
konrad marked this conversation as resolved
Outdated
konrad
commented
Did you try passing the Did you try passing the
viehlieb
commented
Ups, I guess here is something missing Ups, I guess here is something missing
|
||||
if !has || err != nil {
|
||||
return nil, ErrOIDCTeamDoesNotExist{teamName, oidcID}
|
||||
viehlieb marked this conversation as resolved
Outdated
konrad
commented
`Get` will always return one entry, no need for `Asc` or `Limit`.
|
||||
|
|
Loading…
Reference in New Issue
Block a user
This is unnecessary, please remove it