grantType (property)

The grant type defining the authentication flow.

Syntax

@property (nonatomic,readwrite,assign,getter=grantType,setter=setGrantType:) int grantType;
- (int)grantType;
- (void)setGrantType:(int)newGrantType;

/* Possible Values */
OGT_AUTHORIZATION_CODE(0),
OGT_IMPLICIT(1),
OGT_HYBRID(2)
public var grantType: OpenidGrantTypes {
  get {...}
set {...} }
public enum OpenidGrantTypes : Int32 { case ogtAuthorizationCode = 0 case ogtImplicit = 1 case ogtHybrid = 2 }

Default Value

0

Remarks

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 iOS Edition - Version 20.0 [Build 8155]