Système U

Request Auth Token

Triggers Token Exchange via Flutter — Flutter calls back with window.__mmu_receive(token)

Flow (RFC 8693 Token Exchange)

1. Webview calls EC_REDIRECT_AUTH on the Flutter bridge

2. Flutter exchanges AT1 → AT2 with ForgeRock CIAM (scope: espaceclient.partenaire.jeux, 5 min)

3. Flutter injects AT2 into the webview:

// Called by Flutter after token exchange
window.__mmu_receive(accessToken)

4. Webview decodes JWT claims and fetches account data automatically

Fetch Account Data

Auto-called after token arrives · GET /espaceclient/v2/compte

API Documentation

Method: GET  Scope: espaceclient.partenaire.jeux

GET /espaceclient/v2/compte
Authorization: Bearer <AT2>

// 401 → window.MMU.auth.getToken() → Flutter re-exchanges → retry

Returns: nom, prenom, email, numeroCarteU, idIndividu, adresses…

5-minute browser cache — add ?t=<timestamp> for fresh data

Communication Preferences

PUT /espaceclient/compte/allowsCommunication

API Documentation

Method: PUT  Scope: espaceclient.partenaire.jeux

PUT /espaceclient/compte/allowsCommunication
Authorization: Bearer <AT2>
Content-Type: application/json

{ "allowEmail": true, "allowSms": true }

Returns: 204 No Content on success

Copy Code

Copies DEMO2025 to clipboard

API Documentation

navigator.clipboard.writeText('DEMO2025')

Open External URL

Opens www.google.com in the same tab

API Documentation

window.open('https://google.com', '_self')

Camera Access

Accesses device camera via getUserMedia

API Documentation

navigator.mediaDevices.getUserMedia({
  video: { facingMode: 'environment' }
})

Download — URL only

Campaign image PARTNER_DOWNLOAD_FILE with URL only

API Documentation

Handler: PARTNER_DOWNLOAD_FILE

getFlutterHandler('PARTNER_DOWNLOAD_FILE', {
  url: 'https://jeu.magasins-u.com/image/campaign.jpg'
})

Download — URL + Metadata

Campaign image PARTNER_DOWNLOAD_FILE with title, description, folder

API Documentation

Handler: PARTNER_DOWNLOAD_FILE

getFlutterHandler('PARTNER_DOWNLOAD_FILE', {
  url: 'https://jeu.magasins-u.com/image/campaign.jpg',
  title: 'Campagne Système U',
  description: 'Participez à la campagne et gagnez des lots',
  folder: 'systeme-u'
})

Save Image to Phone

Campaign image Saves image directly to device gallery

API Documentation

Handler: PARTNER_DOWNLOAD_FILE

getFlutterHandler('PARTNER_DOWNLOAD_FILE', {
  url: 'https://jeu.magasins-u.com/image/campaign.jpg',
  title: 'Campagne Système U',
  description: 'Participez à la campagne',
  folder: 'systeme-u'
})

Native Share

Campaign image Shares image + text via SHARE_CONTENT handler

API Documentation

Handler: SHARE_CONTENT

getFlutterHandler('SHARE_CONTENT', {
  file_url: 'https://jeu.magasins-u.com/image/campaign.jpg',
  text: 'Participez à la campagne Système U !',
  title: 'Système U — Campagne',
  folder: 'systeme-u'
})