问题
When setting up an application from the API Manager store how can I make the OAuth2 grant types authorization code and implicit the defaults for the app? I know how to do this manually using the carbon interface but I would like to make the two grant types the default.
回答1:
For authorization code and implicit grant types to be enabled by default, you need to specify a callback URL when creating the App on store. When the callback URL is available these 2 grant types will be shown as enabled for the relevant App on management console
Callback URL is mandatory even if you enable authorization code and implicit grant types for an App via management console.
Since authorization code and Implicit grant types require a callback URL, if this is not specified during App creation via store, the server will consider that the App does not support these grant type. That is why these 2 grant types will not be ticked in the App's grant type configurations.
If you need to remove support for a specific grant type for all Apps, you can comment out the following sections under <SupportedGrantTypes>
in <AM_HOME>/repository/conf/identity/identity/xml
Eg: If you need to remove password grant type, comment out the following.
<SupportedGrantType>
<GrantTypeName>password</GrantTypeName>
<GrantTypeHandlerImplClass>org.wso2.carbon.apimgt.keymgt.handlers.ExtendedPasswordGrantHandler</GrantTypeHandlerImplClass>
</SupportedGrantType>
Do not comment out the client credentials
grant type as this is required for Key generation.
来源:https://stackoverflow.com/questions/35136310/wso2am-1-10-0-how-to-set-default-oauth2-grant-types