IPWorks Auth 2020 JavaScript Edition

Questions / Feedback?

GrantType Property

The grant type defining the authentication flow.


 getGrantType(): OpenidGrantTypes;

 setGrantType(grantType: OpenidGrantTypes): void;

enum OpenidGrantTypes { ogtAuthorizationCode, ogtImplicit, ogtHybrid }

Default Value



This property defines the grant type used when performing authentication. The value specified here controls the authentication flow.

Possible values for GrantType are:

  • 0 (Authorization Code - Default)
  • 1 (Implicit)
  • 2 (Hybrid)

When using 0 (Authorization Code Flow - Default) an authorization code is returned from the ServerAuthURL and the class automatically contacts the ServerTokenURL exchanges the authorization code for an ID token and access token.

When using 1 (Implicit Flow) the ServerAuthURL returns an ID token and access token directly. This is only recommended for implementations that are in-browser as this potentially exposes the tokens to the end-user and user agent itself.

When using 2 (Hybrid Flow) an authorization code and potentially one or more tokens are returned by the ServerAuthURL. The class will automatically contact the ServerTokenURL to exchange the authorization code for an ID token and access token.

Additional Notes

The response_type request parameter is automatically set based on the value specified here. In some cases multiple values are acceptable and a default value is chosen automatically. To explicitly specify a response_type value for the chosen grant type set ResponseType after setting this property.

Copyright (c) 2022 /n software inc. - All rights reserved.
IPWorks Auth 2020 JavaScript Edition - Version 20.0 [Build 8262]