0.0.13 • Published 6 years ago

@softheon/armature-saml v0.0.13

Weekly downloads
-
License
-
Repository
-
Last release
6 years ago

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

NameDescription
@Input() public request: RedirectSamlRequestThe request used for generating the saml
@Input() public samlGetEndpointUri: stringThe endpoint used for generating the SAML Response
@Input() samlPostUrl: stringThe endpoint to post the SAML Response to
@Output() samlPostEvent: EventEmitter<boolean>Event emitter indicating when the SAML has been posted

Models

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

API - Services

Abstract SAML Service

Properties

NameDescription
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
NameDescription
request: ISamlRequestThe ISamlRequest object used for generating the SAML
endpointUri: stringThe endpoint used for generating the SAML

Models

ISamlRequest
NameDescription
redirectUrl: stringThe redirect URL used for generating the SAML (Audience and Destination nodes)
ISamlResponse
NameDescription
saml: stringThe base64 encoded SAML Response string

Abstract SAML Entry Service

Methods

readValue: SsoGatewayModel
Parameters
NameDescription
keyPath: stringThe key path for retrieving the data from the SAML redirect
deleteValue: void
Parameters
NameDescription
keyPath: stringThe 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
NameDescription
keyPath: stringThe key path for retrieving the data from the SAML redirect

Models

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

6 years ago

0.0.12

6 years ago

0.0.11

6 years ago

0.0.10

6 years ago

0.0.9

6 years ago

0.0.8

6 years ago

0.0.7

6 years ago

0.0.6

6 years ago

0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago