Documentation
¶
Overview ¶
Package mobilelaunch signs in through the browser the user already uses.
This is the flow Moodle built for its own app: open a page, let the site authenticate however it likes — a password, an institutional login, a hardware key — and have it hand a token back through a URL scheme the client registered.
Everything difficult about it is on the way back. A registered scheme is a name any local program can send to, so the arrival of a well-formed callback proves nothing; what proves something is that it answers a login this process started and has not already finished. That is the transaction store's job; the injected broker owns the platform rule that listening must begin before the browser is opened.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Broker ¶
type Broker interface {
Scheme() string
Installed() bool
OpenAndReceive(context.Context, string, time.Duration, func(bool)) (string, error)
}
Broker is the desktop side of a browser handoff. The interface lives here, where it is consumed; callback.Broker is the platform adapter.
type ClientFactory ¶
ClientFactory builds a transport client for a site.
type Method ¶
type Method struct {
// contains filtered or unexported fields
}
Method signs in through the browser and a registered URL scheme.
func (*Method) Authenticate ¶
func (*Method) Probe ¶
func (m *Method) Probe(_ context.Context, _ site.Site, config *auth.PublicConfig) auth.ProbeResult
Probe reports whether this can work at all.
The handler is checked here rather than at the moment of failure, because "nothing came back" is indistinguishable from a dozen other things and "you have not installed the handler" is actionable.