3.0.0 • Published 5 years ago

@advanced-rest-client/auth-dialogs v3.0.0

Weekly downloads
11
License
Apache-2.0
Repository
github
Last release
5 years ago

Published on NPM

Build Status

Published on webcomponents.org

<auth-dialogs>

Authorization dialogs to provide client credentials for Basic and NTLM authorization schemes. Used primarily in Advanced REST Client.

Usage

Installation

npm install --save @advanced-rest-client/auth-dialogs

In a LitElement

import { LitElement, html } from 'lit-element';
import '@advanced-rest-client/auth-dialogs/auth-dialogs.js';

class SampleElement extends LitElement {
  render() {
    return html`
    <auth-dialog-basic @auth-dialog-closed="${this.onAuthData}"></auth-dialog-basic>
    <auth-dialog-ntlm @auth-dialog-closed="${this.onAuthData}"></auth-dialog-ntlm>
    `;
  }

  onAuthData(e) {
    if (!e.detail.cancelled) {
      console.log(e.detail.value);
    }
  }

  connectedCallback() {
    super.connectedCallback();
    const basic = this.shadowRoot.querySelector('auth-dialog-basic');
    basic.opened = true;
  }
}
customElements.define('sample-element', SampleElement);

Development

git clone https://github.com/advanced-rest-client/auth-dialogs
cd auth-dialogs
npm install

Running the demo locally

npm start

Running the tests

npm test

API components

This components is a part of API components ecosystem