1.0.10 • Published 14 days ago

test-mitid-integrator v1.0.10

Weekly downloads
-
License
MIT
Repository
-
Last release
14 days ago

MitIDIntegrator

A TypeScript class that simplifies authentication processes by managing popup window interactions and message handling.

Key Concept

  • Simplifies integration with authentication systems by handling popup window orchestration for user login and message reception.
  • Automatically captures authentication codes upon receiving a success message.

Features

  • Popup Window Management: Easily open and close popup windows with specified URLs and configurations for a seamless user experience.
  • Message Listening: Continuously monitors messages from popup windows, intelligently processing them based on their source and content.
  • Authentication Code Handling: Safely captures authentication codes from successful logins and securely passes them to designated callback functions when instructed to close the popup.

Getting Started

Prerequisites

  • Environment variables: Ensure the client possesses the requisite environment variables for the MitID broker.
  • Callback function: Have a callback function in place to manage the authentication code.
  • Window Instance: Have a window instance available for data consumption through the message event.

Installation

npm install my-mitid-broker

Usage

// Initialize MitIDIntegrator
const env = {
  BROKER_DOMAIN: "https://mitid-broker.com",
  BROKER_CLIENTID: "client-id",
  REDIRECT_URI: "https://client.com/callback",
};
const integrator = new MitIDIntegrator();

// Open popup window for login
integrator.openPopup("https://example.com/login", (authCode) => {
  console.log("Received authentication code:", authCode);
});

Built With

  • TypeScript: Used for static typing and class-based object-oriented programming.
  • Node.js: JavaScript runtime built on Chrome's V8 JavaScript engine.
  • npm: Package manager for the JavaScript programming language.

Contributing

We welcome contributions from everyone. Before you start, please read our Code of Conduct. We take it very seriously, and expect that you will as well.

How to Contribute

  1. Fork the repository on GitHub.
  2. Make your changes in a new git branch on your fork: git checkout -b my-branch-name
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push your branch to GitHub: git push origin my-branch-name
  5. Open a pull request against the main branch on the original GitHub repository.

For more detailed instructions, refer to the GitHub pull request documentation.

Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

  • MAJOR version when you make incompatible API changes,
  • MINOR version when you add functionality in a backwards-compatible manner, and
  • PATCH version when you make backwards-compatible bug fixes.

For more information on SemVer, please visit semver.org.

Authors

License

MIT License

1.0.10

14 days ago

1.0.9

14 days ago

1.0.8

14 days ago

1.0.7

14 days ago

1.0.6

14 days ago

1.0.5

14 days ago

1.0.4

14 days ago

1.0.3

14 days ago

1.0.2

15 days ago

1.0.1

15 days ago

1.0.0

15 days ago