npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@softheon/armature-saml

v0.0.13

Published

This library includes functionality for generating a SAML that will be used to redirect the user from one Softheon Armature Site to another.

Downloads

20

Readme

Saml

This library includes functionality for generating a SAML that will be used to redirect the user from one Softheon Armature Site to another.

Usage

Include the module

First, include the following module import in your angular root module.

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    SamlModule
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }

Embed the component

Next, embed the component. The component has the functionality to retrieve the SAML OnInit.

<div>
  <saml-redirect-saml [request]="request" [samlGetEndpointUri]="urlForGeneratingRedirectSaml" [samlPostUrl]="urlToPostSamlTo" (isSamlGeneratedEvent)="postSaml()"></saml-redirect-saml>
</div>

Hook into the output event to post the SAML

Then in the typescript, to trigger the redirect, do the following. This utilizes the isSamlGeneratedEvent shown above

/** The app component */
@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.css']
})
export class AppComponent {
  /** The application title */
  public title: string = 'Armature';

  /**
   * Constructs the component
   * @param samlService The saml service
   */
  constructor(
    private readonly samlService: AbstractSamlService
  ) {}

  /** Posts the saml */
  public postSaml(): void {
    this.samlService.shouldPostSaml.next(true);
  }
}

API - Components

RedirectSamlComponent

Properties

| Name | Description | | ------------------------------------------------------- | --------------------------------------------------------- | | @Input() public request: RedirectSamlRequest | The request used for generating the saml | | @Input() public samlGetEndpointUri: string | The endpoint used for generating the SAML Response | | @Input() samlPostUrl: string | The endpoint to post the SAML Response to | | @Output() samlPostEvent: EventEmitter<boolean> | Event emitter indicating when the SAML has been posted |

Models

ISamlRequest

| Name | Description | | --------------------- | ------------------------------------------------------------------------------ | | redirectUrl: string | The redirect URL used for generating the SAML (Audience and Destination nodes) |

RedirectSamlRequest implements ISamlRequest

| Name | Description | | ----------------------- | ------------------------------------------------------------------------------ | | redirectUrl: string | The redirect URL used for generating the SAML (Audience and Destination nodes) | | returnUrl: string | The URl to be used on the other site in case of return | | oAuthIssuer: string | The issuer for configuring OAuth 2.0 | | oAuthClientId: string | The Client ID used OAuth 2.0 Implicit flow | | oAuthScopes: string | The scopes used for the OAuth 2.0 configuration | | logo: string | The logo location for branding the site | | theme: string | The theme name for branding the site | | themeCDN: string | The CDN URL for the theme | | referenceId: string | The reference ID for the redirect | | referenceData: string | The reference data for the redirect |

API - Services

Abstract SAML Service

Properties

| Name | Description | | ------------------------------------ | ---------------------------------------------------------- | | postSaml$: Observable<string> | Observable indicating the provided SAML should be posted | | postSaml: BehaviorSubject<boolean> | BehaviorSubject for controlling what SAML should be posted |

Methods

getSaml: Observable<ISamlResponse>
Parameters

| Name | Description | | ----------------------- | ---------------------------------------------------- | | request: ISamlRequest | The ISamlRequest object used for generating the SAML | | endpointUri: string | The endpoint used for generating the SAML |

Models

ISamlRequest

| Name | Description | | --------------------- | ------------------------------------------------------------------------------ | | redirectUrl: string | The redirect URL used for generating the SAML (Audience and Destination nodes) |

ISamlResponse

| Name | Description | | -------------- | --------------------------------------- | | saml: string | The base64 encoded SAML Response string |

Abstract SAML Entry Service

Methods

readValue: SsoGatewayModel
Parameters

| Name | Description | | ----------------- | ----------------------------------------------------------- | | keyPath: string | The key path for retrieving the data from the SAML redirect |

deleteValue: void
Parameters

| Name | Description | | ----------------- | ----------------------------------------------------------- | | keyPath: string | The key path for retrieving the data from the SAML redirect |

SsoGatewayEntryService extends AbstractSamlEntryService

The implementation utilizes local storage. Its up to the application to determine when to read the values and when to destroy the values.

Methods

readValue: SsoGatewayModel
Parameters

| Name | Description | | ----------------- | ----------------------------------------------------------- | | keyPath: string | The key path for retrieving the data from the SAML redirect |

Models

SsoGatewayModel

| Name | Description | | --------------------------------------- | ----------------------------------------------- | | Assertions: { [key: string]: string } | The assertions that were read from the saml | | Issuer: string | The issuer from the SAML | | Audience: string | The audience from the SAML | | Destination: string | The Destination of the SAML | | Hash: string | The data integrity hash | | KeyPath: string | The Key Path suffix used for storing the values |