Skip to content

Glauth account lookup #668

Closed
Closed

Description

@Cyb3rDudu

ocis running here: https://ocis-bridge.owncloud.works
oc10 running here: https://oc10-bridge.owncloud.works

oc10

login to https://oc10-bridge.owncloud.works (owncloud 10) works for user felix, [email protected]

ocis web

When logging in to https://ocis-bridge.owncloud.works via ocis web getting error:

# request nr 1 to graphapi from admin
owncloud_1  | 192.168.96.2 - admin [08/Oct/2020:16:53:47 +0000] "GET /index.php/apps/graphapi/v1.0/ocs/v2.php/cloud/user?format=json HTTP/1.1" 302 968 "-" "Go-http-client/2.0"
owncloud_1  | 192.168.96.2 - admin [08/Oct/2020:16:53:47 +0000] "GET /login HTTP/1.1" 200 3113 "https://oc10-bridge.owncloud.works/index.php/apps/graphapi/v1.0/ocs/v2.php/cloud/user?format=json" "Go-http-client/2.0"
owncloud_1  | 192.168.96.2 - admin [08/Oct/2020:16:53:47 +0000] "GET /index.php/apps/graphapi/v1.0/users HTTP/1.1" 200 1297 "-" "Go-http-client/2.0"

# request nr 2 to graphapi from felix
owncloud_1  | 192.168.96.2 - felix [08/Oct/2020:16:53:47 +0000] "GET /index.php/apps/graphapi/v1.0/ocs/v2.php/cloud/user?format=json HTTP/1.1" 302 964 "-" "Go-http-client/2.0"
owncloud_1  | 192.168.96.2 - felix [08/Oct/2020:16:53:47 +0000] "GET /login HTTP/1.1" 200 3118 "https://oc10-bridge.owncloud.works/index.php/apps/graphapi/v1.0/ocs/v2.php/cloud/user?format=json" "Go-http-client/2.0"

# request nr 3 to graphapi from admin
owncloud_1  | 192.168.96.2 - admin [08/Oct/2020:16:53:47 +0000] "GET /index.php/apps/graphapi/v1.0/ocs/v2.php/cloud/user?format=json HTTP/1.1" 302 970 "-" "Go-http-client/2.0"
owncloud_1  | 192.168.96.2 - admin [08/Oct/2020:16:53:47 +0000] "GET /login HTTP/1.1" 200 3110 "https://oc10-bridge.owncloud.works/index.php/apps/graphapi/v1.0/ocs/v2.php/cloud/user?format=json" "Go-http-client/2.0"
owncloud_1  | 192.168.96.2 - admin [08/Oct/2020:16:53:47 +0000] "GET /index.php/apps/graphapi/v1.0/users/felix HTTP/1.1" 200 1162 "-" "Go-http-client/2.0"

# request nr 4 to graphapi from admin
owncloud_1  | 192.168.96.2 - admin [08/Oct/2020:16:54:50 +0000] "GET /index.php/apps/graphapi/v1.0/ocs/v2.php/cloud/user?format=json HTTP/1.1" 302 972 "-" "Go-http-client/2.0"
owncloud_1  | 192.168.96.2 - admin [08/Oct/2020:16:54:50 +0000] "GET /login HTTP/1.1" 200 3117 "https://oc10-bridge.owncloud.works/index.php/apps/graphapi/v1.0/ocs/v2.php/cloud/user?format=json" "Go-http-client/2.0"
owncloud_1  | 192.168.96.2 - admin [08/Oct/2020:16:54:50 +0000] "GET /index.php/apps/graphapi/v1.0/users/felix HTTP/1.1" 200 1162 "-" "Go-http-client/2.0"

# request nr 5 to graphapi from admin
owncloud_1  | 192.168.96.2 - admin [08/Oct/2020:16:54:50 +0000] "GET /index.php/apps/graphapi/v1.0/ocs/v2.php/cloud/user?format=json HTTP/1.1" 302 968 "-" "Go-http-client/2.0"
owncloud_1  | 192.168.96.2 - admin [08/Oct/2020:16:54:50 +0000] "GET /login HTTP/1.1" 200 3124 "https://oc10-bridge.owncloud.works/index.php/apps/graphapi/v1.0/ocs/v2.php/cloud/user?format=json" "Go-http-client/2.0"
owncloud_1  | 192.168.96.2 - admin [08/Oct/2020:16:54:50 +0000] "GET /index.php/apps/graphapi/v1.0/users/felix HTTP/1.1" 200 1158 "-" "Go-http-client/2.0"

# ocis still not happy
ocis_1      | 2020-10-08T16:54:51Z ERR Account not found query="mail eq '[email protected]'" service=proxy

ldapsearch

Searching via ldapsearch against glauth works and returns a single user like that:

ldapsearch -x -H ldap://localhost:9125 -D "cn=admin,dc=example,dc=org" -b "dc=example,dc=org" -W "(&(objectclass=posixaccount)([email protected]))"

produces

owncloud_1  | 192.168.96.2 - admin [08/Oct/2020:16:45:54 +0000] "GET /index.php/apps/graphapi/v1.0/ocs/v2.php/cloud/user?format=json HTTP/1.1" 302 968 "-" "Go-http-client/2.0"
owncloud_1  | 192.168.96.2 - admin [08/Oct/2020:16:45:54 +0000] "GET /login HTTP/1.1" 200 3119 "https://oc10-bridge.owncloud.works/index.php/apps/graphapi/v1.0/ocs/v2.php/cloud/user?format=json" "Go-http-client/2.0"
owncloud_1  | 192.168.96.2 - admin [08/Oct/2020:16:45:54 +0000] "GET /index.php/apps/graphapi/v1.0/users HTTP/1.1" 200 1295 "-" "Go-http-client/2.0"

result looks good:

# extended LDIF
#
# LDAPv3
# base <dc=example,dc=org> with scope subtree
# filter: (&(objectclass=posixaccount)([email protected]))
# requesting: ALL
#

# felix, users, example.org
dn: cn=felix,ou=users,dc=example,dc=org
cn: felix
uid: felix
givenName: felix
mail: [email protected]
objectClass: posixAccount
description: felix from ownCloud

# search result
search: 2
result: 0 Success

# numResponses: 2
# numEntries: 1

graph api on co10

works nicely:

curl https://oc10-bridge.owncloud.works/index.php/apps/graphapi/v1.0/users -u admin | jq
Enter host password for user 'admin':
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   197  100   197    0     0    269      0 --:--:-- --:--:-- --:--:--   269
{
  "value": [
    {
      "id": "admin",
      "displayName": "admin",
      "mail": null
    },
    {
      "id": "einstein",
      "displayName": "einstein",
      "mail": "[email protected]"
    },
    {
      "id": "felix",
      "displayName": "felix",
      "mail": "[email protected]"
    }
  ]
}

Activity

  1. butonic commented on Oct 8, 2020

    @butonic
    Contributor

    how are you running glauth? when the backend data is owncloud the usegraphapi flag must be true to use the graph api. it seems your config has usegraphapi false. so it uses the ocs api but with the graphapi endpoints you configured.

    the default flags look correct:

    &cli.BoolFlag{
    Name: "fallback-use-graphapi",
    Value: true,
    Usage: "use Graph API, only for owncloud datastore",
    EnvVars: []string{"GLAUTH_FALLBACK_USE_GRAPHAPI"},
    Destination: &cfg.Fallback.UseGraphAPI,
    },

    if is passed on correctly:

    UseGraphAPI: cfg.Fallback.UseGraphAPI,

    I dont see how you start the service .... that is all the help I can give.

  2. Cyb3rDudu commented on Oct 8, 2020

    @Cyb3rDudu
    ContributorAuthor
  3. micbar commented on Oct 8, 2020

    @micbar
    Contributor

    @JamU85 @felixboehm If you are using ocis master, all REVA_ variables are now renamed to STORAGE_

    The REVA_* variables will have no effect on this config.

    Here is the always up-to-date config (gets parsed from the go config files) https://owncloud.github.io/extensions/storage/configuration/

  4. Cyb3rDudu commented on Oct 9, 2020

    @Cyb3rDudu
    ContributorAuthor

    Proxy config file wasn't parsed properly, thats why policy selector was just default.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions