You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The two WebFinger calls are intentional and serve different purposes in the authentication flow. This applies to all OpenCloud clients (Desktop, Mobile, Web).
Architecture Overview
sequenceDiagram
participant User
participant Client as Client\n(Desktop/Mobile/Web)
participant LookupServer as Lookup Server\n(OpenCloud)
participant IdP as IdP\n(OpenCloud)
participant Instance as User's OpenCloud\nInstance
Note over User,Instance: Phase 1: Server Discovery & Authentication Method Detection
User->>Client: Enter server URL (e.g., opencloud.eu)
Client->>LookupServer: GET /.well-known/webfinger?resource={serverUrl}\n(Unauthenticated)
Note right of LookupServer: First WebFinger call:\nCheck if WebFinger auth\nis available
LookupServer-->>Client: WebFinger response with OIDC issuer link\n(rel="http://openid.net/specs/connect/1.0/issuer")
Client->>Client: Store authentication server URL
Note over User,Instance: Phase 2: OAuth Authentication
Client->>IdP: GET /.well-known/openid-configuration
IdP-->>Client: OpenID configuration (auth & token endpoints)
Client->>User: Open browser for OAuth login
User->>IdP: Authenticate
IdP-->>Client: Access token & refresh token
Note over User,Instance: Phase 3: Instance Discovery
Client->>LookupServer: GET /.well-known/webfinger?resource=acct:me@{host}\nAuthorization: Bearer {token}\n(Authenticated)
Note right of LookupServer: Second WebFinger call:\nDiscover user's\nOpenCloud instance(s)
LookupServer-->>Client: WebFinger response with instance URLs\n(rel="http://webfinger.opencloud/rel/server-instance")
Client->>Client: Select first instance from list
Client->>Instance: Connect to user's OpenCloud instance
Loading
The Two Calls Explained
1️⃣ First WebFinger Call (Unauthenticated)
GET /.well-known/webfinger?resource=https://opencloud.eu
Purpose: Discover if server supports WebFinger-based auth and find the IdP
Activity
TheOneRing commentedon May 20, 2025
@butonic @rhafer do you know why we do that or whether its an artifact from refactoring?
michaelstingl commentedon May 26, 2025
Why OpenCloud Clients Perform WebFinger Twice - Documentation
The two WebFinger calls are intentional and serve different purposes in the authentication flow. This applies to all OpenCloud clients (Desktop, Mobile, Web).
Architecture Overview
sequenceDiagram participant User participant Client as Client\n(Desktop/Mobile/Web) participant LookupServer as Lookup Server\n(OpenCloud) participant IdP as IdP\n(OpenCloud) participant Instance as User's OpenCloud\nInstance Note over User,Instance: Phase 1: Server Discovery & Authentication Method Detection User->>Client: Enter server URL (e.g., opencloud.eu) Client->>LookupServer: GET /.well-known/webfinger?resource={serverUrl}\n(Unauthenticated) Note right of LookupServer: First WebFinger call:\nCheck if WebFinger auth\nis available LookupServer-->>Client: WebFinger response with OIDC issuer link\n(rel="http://openid.net/specs/connect/1.0/issuer") Client->>Client: Store authentication server URL Note over User,Instance: Phase 2: OAuth Authentication Client->>IdP: GET /.well-known/openid-configuration IdP-->>Client: OpenID configuration (auth & token endpoints) Client->>User: Open browser for OAuth login User->>IdP: Authenticate IdP-->>Client: Access token & refresh token Note over User,Instance: Phase 3: Instance Discovery Client->>LookupServer: GET /.well-known/webfinger?resource=acct:me@{host}\nAuthorization: Bearer {token}\n(Authenticated) Note right of LookupServer: Second WebFinger call:\nDiscover user's\nOpenCloud instance(s) LookupServer-->>Client: WebFinger response with instance URLs\n(rel="http://webfinger.opencloud/rel/server-instance") Client->>Client: Select first instance from list Client->>Instance: Connect to user's OpenCloud instanceThe Two Calls Explained
1️⃣ First WebFinger Call (Unauthenticated)
rel="http://openid.net/specs/connect/1.0/issuer"2️⃣ Second WebFinger Call (Authenticated)
acct:me@{host}(authenticated user identifier)rel="http://webfinger.opencloud/rel/server-instance"Why This Design?
The Lookup Server component in OpenCloud handles both WebFinger requests but with different logic based on authentication state and resource type.
This is not a refactoring artifact but an intentional design that enables flexible deployment architectures across all client platforms.
docs: Add code comments explaining dual WebFinger calls
kulmann commentedon May 27, 2025
I can confirm this - at least that's what I understood as well, when we did the implementation back then. See also the service readme: https://github.com/opencloud-eu/opencloud/blob/main/services/webfinger/README.md
TheOneRing commentedon May 27, 2025
Thanks to you both
Svanvith commentedon May 30, 2025
The service Readme is also now available in our dev docs https://docs.opencloud.eu/docs/dev/server/services/webfinger/information
docs: Add code comments explaining dual WebFinger calls
docs: Add code comments explaining dual WebFinger calls