GrantType Property

The OAuth grant type used to acquire an OAuth access token.

Syntax

ANSI (Cross Platform)
int GetGrantType();
int SetGrantType(int iGrantType); Unicode (Windows) INT GetGrantType();
INT SetGrantType(INT iGrantType);

Possible Values

OGT_AUTHORIZATION_CODE(0), 
OGT_IMPLICIT(1),
OGT_PASSWORD(2),
OGT_CLIENT_CREDENTIALS(3)
@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_PASSWORD(2),
OGT_CLIENT_CREDENTIALS(3)
#define PID_OAUTH_GRANTTYPE 22

IPWORKSAUTH_EXTERNAL void* IPWORKSAUTH_CALL IPWorksAuth_OAuth_Get(void *lpObj, int propid, int arridx, int *lpcbVal, int64 *lpllVal);
IPWORKSAUTH_EXTERNAL int IPWORKSAUTH_CALL IPWorksAuth_OAuth_Set(void *lpObj, int propid, int arridx, const void *val, int cbVal);

Default Value

0

Remarks

This setting specifies the type of grant to obtain. In most cases the Authorization Code grant type (default) is used, so it is typically not necessary to change this. The supported values are:

  • 0 (Authorization Code - Default)
  • 1 (Implicit)
  • 2 (Resource Owner Password Credentials)
  • 3 (Client Credentials)

For all grant types listed set ClientProfile to Application.

The Authorization Code grant is the most commonly used grant type. It follows the flow described for the Application Client Type section in the OAuth introduction page.

Implicit grants are similar to Authorization Code, except that a Bearer token is returned directly from the authorization server without requiring a second step to exchange a code for a bearer token. To use this grant type set:

And call GetAuthorization.

The Resource Owner Password Credentials grant type may be used to authenticate on behalf of a resource owner with the owner's credentials. Authentication is performed directly and the user is not prompted to authenticate the application. To use this grant type set:

And call GetAuthorization.

The Client Credentials grant type is typically used for server-to-server authentication. The client authenticates directly to the authentication server and receives a token without any user interaction. To use this grant type set:

And call GetAuthorization.

Data Type

Integer

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