mobilelaunch

package
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 13, 2026 License: MIT Imports: 13 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

type ClientFactory func(target site.Site) *moodle.Client

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 New

func New(newClient ClientFactory, broker Broker) *Method

New builds the method.

func (*Method) Authenticate

func (m *Method) Authenticate(ctx context.Context, req auth.Request) (auth.Credential, error)

func (*Method) Describe

func (*Method) Describe() string

func (*Method) Name

func (*Method) Name() string

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL