Uploaded image for project: 'Node.js Driver'
  1. Node.js Driver
  2. NODE-5062

OIDC: Add Documentation Examples

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Unknown Unknown
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • 1
    • Hide

      DRIVERS-2550:
      Summary of necessary driver changes

      •  Add documentation for MONGODB-OIDC to existing authentication documentation.
      • Include examples for:
      • Azure IMDS with connection string
      • Azure Functions/ASE with custom callback
      • Azure AKS token with custom callback
      • GCP IMDS with connection string
      • GCP GKE token with custom callback
      Show
      DRIVERS-2550 : Summary of necessary driver changes  Add documentation for MONGODB-OIDC to existing authentication documentation. Include examples for: Azure IMDS with connection string Azure Functions/ASE with custom callback Azure AKS token with custom callback GCP IMDS with connection string GCP GKE token with custom callback See https://github.com/mongodb/mongo-python-driver/commit/2588ca3782c874fa5b6b80d886f4f5fb6607bdb3 and https://github.com/mongodb/mongo-python-driver/commit/b6f0081cf9d2af20dd9d709a7963edcd802f26b6 from the Python implementation
    • Not Needed
    • Needed
    • Hide

      When the docs team gets to implementing OIDC docs for the Node driver, the following example may be used to demonstrate callback authentication:

      connect.ts

      import { MongoClient } from 'mongodb';
      import { createMongoDBOIDCPlugin } from '@mongodb-js/oidc-plugin';
      
      // All config options are optional.
      const config = {
        openBrowser: {
          command: 'open -a "Firefox"',
        },
      };
      
      const client = await MongoClient.connect(
        'mongodb+srv://.../?authMechanism=MONGODB-OIDC',
        {
          ...createMongoDBOIDCPlugin(config).mongoClientOptions,
        }
      );
      
      // ...
      

      See also: https://github.com/mongodb-js/oidc-plugin/#mongodb-jsoidc-plugin

      Show
      When the docs team gets to implementing OIDC docs for the Node driver, the following example may be used to demonstrate callback authentication: connect.ts import { MongoClient } from 'mongodb' ; import { createMongoDBOIDCPlugin } from '@mongodb-js/oidc-plugin' ; // All config options are optional. const config = { openBrowser: { command: 'open -a "Firefox" ' , }, }; const client = await MongoClient.connect( 'mongodb+srv: //.../?authMechanism=MONGODB-OIDC' , { ...createMongoDBOIDCPlugin(config).mongoClientOptions, } ); // ... See also: https://github.com/mongodb-js/oidc-plugin/#mongodb-jsoidc-plugin

      This ticket was split from DRIVERS-2550, please see that ticket for a detailed description.

      AC:

      • Add an example for using the OIDC plugin in the docs changes section of this ticket.
      • Create PR to add example on docs-node

            Assignee:
            durran.jordan@mongodb.com Durran Jordan
            Reporter:
            dbeng-pm-bot PM Bot
            Neal Beeken
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: