--- title: "SSO OAuth (Microsoft)" slug: "fmadio-os-authentication-sso-oauth-ms" updated: 2026-10-13T14:42:00Z published: 2026-10-13T14:42:00Z canonical: "docs.fmad.io/fmadio-os-authentication-sso-oauth-ms" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.fmad.io/llms.txt > Use this file to discover all available pages before exploring further. # SSO OAuth (Microsoft) FMADIO Capture devices can authenticate the users using Active Directory via the OAUTH 2.0 protocol. This enables Single Sign-On with ADFS. The example described below assumes the FMADIO can directly access the OAUTH server. In most cases, a proxy is required, which is described at the end of the document. ## Step 1) OAuth Config Next, create a file named `/opt/fmadio/etc/oauth_opts.lua` This file contains the ADFS OAuth endpoints as follows ```plaintext local config = {    redirect_uri                = "https://fmadio100v2-ip-address:443/secure/",    discovery                   = "https://login.microsoftonline.com/571b0fe2-75cb-48de-9144-0cb928e90751/v2.0/.well-known/openid-configuration",    client_id                   = "d41c59e7-6906-4569-9cc0-c6762541d2cd",    client_secret               = "fSY7Q~dkbG~mHlJYipKiC0XCMhnXQbOkOP5iE",    ssl_verify                  = "no",    scope                       = "openid email profile",    redirect_uri_scheme         = "https",    proxy_opts =    {        https_proxy             = nil,    } } return config ``` These fields are from the ADFS Endpoint URI information, for example as follows. We created a fmadio sign-in entry, this has the following client_id entered above. The "discovery" config above needs to be the OpenID Connect Metadata document, as seen below. ![](https://cdn.document360.io/b9aab0c4-36d0-4616-9673-30b661455571/Images/Documentation/image(36).png?sv=2026-02-06&spr=https&st=2026-11-24T09%3A34%3A09Z&se=2026-11-24T10%3A34%3A09Z&sr=b&sp=r&sig=OLmixWWeBC%2B2Rel3i88HlTv1dTrAe1Vmii4mLxgxGSM%3D) The "client_id" is shown below. ![](https://cdn.document360.io/b9aab0c4-36d0-4616-9673-30b661455571/Images/Documentation/image(37).png?sv=2026-02-06&spr=https&st=2026-11-24T09%3A34%3A09Z&se=2026-11-24T10%3A34%3A09Z&sr=b&sp=r&sig=NTD71YpWSj%2BwC%2B2BJjhEWbYomSMuUU8cfdbIedQ165Q%3D) The "client_secret" in the above config needs to be the Value shown below, not the secretID ![](https://cdn.document360.io/b9aab0c4-36d0-4616-9673-30b661455571/Images/Documentation/image(38).png?sv=2026-02-06&spr=https&st=2026-11-24T09%3A34%3A09Z&se=2026-11-24T10%3A34%3A09Z&sr=b&sp=r&sig=4%2F331x1X%2BcZWkHlkKrHs48zgVc4rYTTJqzOwJZB%2F2Ig%3D) Finally, the "redirect_uri" needs to be registered as follows. ![](https://cdn.document360.io/b9aab0c4-36d0-4616-9673-30b661455571/Images/Documentation/image(39).png?sv=2026-02-06&spr=https&st=2026-11-24T09%3A34%3A09Z&se=2026-11-24T10%3A34%3A09Z&sr=b&sp=r&sig=taaRyfjkEkeasOO7eXKJyu2CDum%2Fm84dgcqN88w7OAE%3D) Once the config is complete, please confirm there are no syntax errors by running ```plaintext fmadiolua /opt/fmadio/etc/oauth_opts.lua ``` Correct output is as follows. If there are any syntax errors please correct them. ![](https://cdn.document360.io/b9aab0c4-36d0-4616-9673-30b661455571/Images/Documentation/image(40).png?sv=2026-02-06&spr=https&st=2026-11-24T09%3A34%3A09Z&se=2026-11-24T10%3A34%3A09Z&sr=b&sp=r&sig=f2zWzDIOJicudU3W80lAIVPLBLtokSUvShhNUtES4xY%3D) ### Step 2) Update the system configuration for OAuth and nginx Run the following to update the system configuration files to map nginx to the OAuth proxy/SSO module, instead of standard basic authentication (htpasswd) ```plaintext config security auth oauth ``` To verify success, run “show security” inside the fmadiocli to confirm the authentication model is now set to OAuth. ### Step 3) Restart nginx Restart nginx to load the new configuration files by killing the process as below. It will respawn on a 1-minute cron job automatically ```plaintext sudo killall nginx ``` It can take 60 to 120sec for nginx to restart again. ### Step 4) Logging in Next, open a browser to the FMADIO device, it should redirect you to the Active Directory login page as follows. ![](https://cdn.document360.io/b9aab0c4-36d0-4616-9673-30b661455571/Images/Documentation/image(41).png?sv=2026-02-06&spr=https&st=2026-11-24T09%3A34%3A09Z&se=2026-11-24T10%3A34%3A09Z&sr=b&sp=r&sig=qwd8JKulhOngXBxPrMl0ukdIUbpMv6g0U2mxAOow0Hk%3D) Log in to the system using your Azure / Microsoft credentials. Then the FMADIO device dashboard will be shown as below. ![](https://cdn.document360.io/b9aab0c4-36d0-4616-9673-30b661455571/Images/Documentation/image(42).png?sv=2026-02-06&spr=https&st=2026-11-24T09%3A34%3A09Z&se=2026-11-24T10%3A34%3A09Z&sr=b&sp=r&sig=TKI357nq5N98vW1dWfyQq7uchTb%2B2wzeOC37nr3TWqA%3D) ### Step 5) Logout Logout is the same, using the logout button shown below ![](https://cdn.document360.io/b9aab0c4-36d0-4616-9673-30b661455571/Images/Documentation/image(43).png?sv=2026-02-06&spr=https&st=2026-11-24T09%3A34%3A09Z&se=2026-11-24T10%3A34%3A09Z&sr=b&sp=r&sig=s%2FvMqoUPt54kGy2KKQVPFMoeEe1FNoMpFC%2Fu2jSXKdc%3D) Then choose an account to sign out of ![](https://cdn.document360.io/b9aab0c4-36d0-4616-9673-30b661455571/Images/Documentation/image(44).png?sv=2026-02-06&spr=https&st=2026-11-24T09%3A34%3A09Z&se=2026-11-24T10%3A34%3A09Z&sr=b&sp=r&sig=%2B9ANLtw7u8A%2BpwnjtcoD6Ti1Jyi2C8pUic8bMo0fscA%3D) ## Proxy Setting This example above assumes the OAUTH server can be accessed directly from the FMADIO. In most cases, this is not possible, instead, there is a proxy through which external web access must be routed. **FMADIO only supports HTTPS through an HTTP proxy on the local network.** This Proxy can then reach out to the external authentication service (such as login.microsoftonline.com ). It’s likely this proxy will need some tweeks / access controls to allow the FMADIO system to communicate with the authentication service. To configure this, update the oauth_opts.lua configuration file as follows ```plaintext local config = {    redirect_uri                = "https://fmadio100v2-ip-address:443/secure/",    discovery                   = "https://login.microsoftonline.com/571b0fe2-75cb-48de-9144-0cb928e90751/v2.0/.well-known/openid-configuration",    client_id                   = "d41c59e7-6906-4569-9cc0-c6762541d2cd",    client_secret               = "fSY7Q~dkbG~mHlJYipKiC0XCMhnXQbOkOP5iE",    ssl_verify                  = "no",    scope                       = "openid email profile",    redirect_uri_scheme         = "https",    proxy_opts =    {        https_proxy             = "http://local_http_proxy:portnumber",    } } return config ``` Note: the URL endpoint must be http (not https) even tho the final endpoint is a TLS connection.