Fable.OidcClient
Fable binding for oidc-client-js javascript library
Install / Use
/learn @mjarosie/Fable.OidcClientREADME
Fable.OidcClient 
Library to provide OpenID Connect (OIDC) and OAuth2 protocol support for client applications written in F#. It's a Fable binding for oidc-client javascript library.
How to start using this package
In a directory where your project's .fsproj file is:
dotnet add package Fable.OidcClient
In a directory where your project's package.json is:
npm install oidc-client
Examples
Repositories showing examples of using Fable.OidcClient with:
- Fable application: FableBrowserClientOpenIdConnect (based on IdentityServer "Adding a JavaScript client" tutorial)
- Elmish single page application: ElmishSpaOpenIdConnect
Initialise the User Manager
open Fable.OidcClient
open Fable.Core.JsInterop // Required for the "!!" operator.
let settings: UserManagerSettings =
!!{|
authority = Some "https://localhost:5001"
client_id = Some "js"
redirect_uri = Some "https://localhost:5003/callback.html"
response_type = Some "code"
scope = Some "openid profile scope1"
post_logout_redirect_uri = Some "https://localhost:5003/index.html"
filterProtocolClaims = Some true
loadUserInfo = Some true
|}
let mgr: UserManager = Oidc.UserManager.Create settings
// From here you can call
// mgr.signinRedirect() to redirect to login page,
// mgr.signoutRedirect() to redirect to logout page,
// mgr.getUser() to retrieve user's details,
// etc...
Handle the OpenId Connect redirect protocol
open Fable.OidcClient
open Fable.Core.JsInterop
let mgr: UserManager = Oidc.UserManager.Create !!{| response_mode = Some "query" |}
promise {
console.log "mgr.signinRedirectCallback()"
let! user = mgr.signinRedirectCallback()
console.log (sprintf "%A" user)
window.location.href <- "index.html"
} |> ignore
Related Skills
node-connect
344.1kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
96.8kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
344.1kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
344.1kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
