使用app_auth_code换取app_auth_token

@param model
{AlipayOpenAuthTokenAppModel}
@return {AlipayOpenAuthTokenAppResponse}
@throws {AlipayApiException}
168442
public static AlipayOpenAuthTokenAppResponse openAuthTokenAppToResponse(AlipayOpenAuthTokenAppModel model)
			throws AlipayApiException {
		AlipayOpenAuthTokenAppRequest request = new AlipayOpenAuthTokenAppRequest();
		request.setBizModel(model);
		return AliPayApiConfigKit.getAliPayApiConfig().getAlipayClient().execute(request);
	}
1332745
def auth_app(self, app_id, app_secret, auth_code, state=''):
        
        headers = {
            'Content-type': 'application/json'
        }
        payload = {
            'application': app_id,
            'auth_code': auth_code,
            'state': state
        }
        try:
            full_url = utils.urljoin(
                self.host,
                '/api/v1/application-tokens/validate'
            )
            response = requests.post(
                full_url,
                data=json.dumps(payload),
                headers=headers,
                verify=self.tls_verify
            )
        except RequestException:
            raise exceptions.TaigaRestException(
                full_url, 400,
                'NETWORK ERROR', 'POST'
            )
        if response.status_code != 200:
            raise exceptions.TaigaRestException(
                full_url,
                response.status_code,
                response.text,
                'POST'
            )
        cyphered_token = response.json().get('cyphered_token', '')
        if cyphered_token:
            from jwkest.jwk import SYMKey
            from jwkest.jwe import JWE

            sym_key = SYMKey(key=app_secret, alg='A128KW')
            data, success = JWE().decrypt(cyphered_token, keys=[sym_key]), True
            if isinstance(data, tuple):
                data, success = data
            try:
                self.token = json.loads(data.decode('utf-8')).get('token', None)
            except ValueError:  # pragma: no cover
                self.token = None
            if not success:
                self.token = None
        else:
            self.token = None

        if self.token is None:
            raise exceptions.TaigaRestException(
                full_url, 400,
                'INVALID TOKEN', 'POST'
            )

        self.raw_request = RequestMaker('/api/v1', self.host, self.token,
                                        'Application', self.tls_verify)
        self._init_resources()
1210303
public function publishCard(RawSignedModel $model, $token)
    {
        $httpResponse = $this->httpClient->send(
            new PostHttpRequest(
                $this->serviceUrl . "/card/v5",
                json_encode($model, JSON_UNESCAPED_SLASHES),
                ["Authorization" => sprintf("Virgil %s", $token)]
            )
        );

        if (!$httpResponse->getHttpStatusCode()
                          ->isSuccess()) {
            return $this->parseErrorResponse($httpResponse->getBody());
        }

        return RawSignedModel::RawSignedModelFromJson($httpResponse->getBody());
    }
1155966
@SuppressWarnings("unchecked")
    public Response insert(@NotNull @Valid final MODEL model) throws Exception {
        matchedInsert(model);
        setForInsertId(model);

        executeTx(t -> {
            preInsertModel(model);
            insertModel(model);
            postInsertModel(model);
        });
        MODEL_ID id = (MODEL_ID) this.server.getBeanId(model);

        return Response.created(buildLocationUri(id)).build();
    }
624644
public static AlipayEbppBillGetResponse ebppBillGet(String orderType, String merchantOrderNo)
			throws AlipayApiException {
		AlipayEbppBillGetRequest request = new AlipayEbppBillGetRequest();
		request.setOrderType(orderType);
		request.setMerchantOrderNo(merchantOrderNo);
		return AliPayApiConfigKit.getAliPayApiConfig().getAlipayClient().execute(request);
	}
639400
function (model) {
              var tokenCode = 'token-' + md5(new Date().toString()) + md5(model.id + Math.random().toString());
              var redisExpire = (global._gluon_auth_expire) >>> 0; //redis using seconds not milliseconds
              return redisClient.setAsync(tokenCode, JSON.stringify(model.toJSON())).then(function () {
                return redisClient.expireAsync(tokenCode, redisExpire);
              }).then(function () {
                return {code: tokenCode, expire: new Date(Date.now() + redisExpire * 1000)};
              });
            }
796353
private ModelAndView getImplicitGrantOrHybridResponse(
      AuthorizationRequest authorizationRequest,
      Authentication authentication,
      String grantType
    ) {
        OAuth2AccessToken accessToken;
        try {
            TokenRequest tokenRequest = getOAuth2RequestFactory().createTokenRequest(authorizationRequest, GRANT_TYPE_IMPLICIT);
            Map<String, String> requestParameters = new HashMap<>(authorizationRequest.getRequestParameters());
            requestParameters.put(GRANT_TYPE, grantType);
            authorizationRequest.setRequestParameters(requestParameters);
            OAuth2Request storedOAuth2Request = getOAuth2RequestFactory().createOAuth2Request(authorizationRequest);
            accessToken = getAccessTokenForImplicitGrantOrHybrid(tokenRequest, storedOAuth2Request, grantType);
            if (accessToken == null) {
                throw new UnsupportedResponseTypeException("Unsupported response type: token or id_token");
            }
            return new ModelAndView(
              new RedirectView(
                buildRedirectURI(authorizationRequest, accessToken, authentication),
                false,
                true,
                false
              )
            );
        } catch (OAuth2Exception e) {
            return new ModelAndView(new RedirectView(getUnsuccessfulRedirect(authorizationRequest, e, true), false,
              true, false));
        }
    }
497305
public static AlipayTradeOrderSettleResponse tradeOrderSettleToResponse(AlipayTradeOrderSettleModel model,
			String appAuthToken) throws AlipayApiException {
		AlipayTradeOrderSettleRequest request = new AlipayTradeOrderSettleRequest();
		request.setBizModel(model);
		return AliPayApiConfigKit.getAliPayApiConfig().getAlipayClient().execute(request, null, appAuthToken);
	}
171190
function registerApi(isApp, apiObject) {

  if (isApp) {
    return function (req, res, next) {
      res.__api = apiObject;
      return next();
    };
  };
  
  return function (req, res, next) {
    res.__modelAPI = apiObject;
    return next();
  };
}
955112
@Override
    public InstagramAccessTokenResponse getAccessToken(String redirectUri,
                                                       String code) throws InstagramError {
        return instagramEndpoints.getAccessToken(applicationKey, applicationSecret, "authorization_code", redirectUri, code);
    }
184931
public AppPayResponse appPay(PayRequest request){
        checkPayParams(request);
        Map<String, Object> respData = doAppPay(request, TradeType.APP);
        return buildAppPayResp(respData);
    }
389034
public static AlipayTradeCloseResponse tradeCloseToResponse(AlipayTradeCloseModel model, String appAuthToken)
			throws AlipayApiException {
		AlipayTradeCloseRequest request = new AlipayTradeCloseRequest();
		request.setBizModel(model);
		return AliPayApiConfigKit.getAliPayApiConfig().getAlipayClient().execute(request, null, appAuthToken);

	}
875349
function (checkoutModel) {

        if (!checkoutModel) {
            return null;
        }

        var modelCopy = sofa.Util.clone(checkoutModel);
        var requestModel = {};

        if (modelCopy.billingAddress && modelCopy.billingAddress.country) {
            modelCopy.billingAddress.country = checkoutModel.billingAddress.country.value;
            modelCopy.billingAddress.countryLabel = checkoutModel.billingAddress.country.label;
            requestModel.invoiceAddress = JSON.stringify(modelCopy.billingAddress);
        }

        if (modelCopy.shippingAddress && modelCopy.shippingAddress.country) {
            modelCopy.shippingAddress.country = checkoutModel.shippingAddress.country.value;
            modelCopy.shippingAddress.countryLabel = checkoutModel.shippingAddress.country.label;
            requestModel.shippingAddress = JSON.stringify(modelCopy.shippingAddress);
        }

        if (modelCopy.selectedPaymentMethod && modelCopy.selectedPaymentMethod.method) {
            requestModel.paymentMethod = modelCopy.selectedPaymentMethod.method;
        } else {
            requestModel.paymentMethod = modelCopy.selectedPaymentMethod;
        }

        if (modelCopy.selectedShippingMethod && modelCopy.selectedShippingMethod.method) {
            requestModel.shippingMethod = modelCopy.selectedShippingMethod.method;
        }

        requestModel.quote = JSON.stringify(self.createQuoteData());

        var coupons = basketService.getActiveCoupons().map(function (coupon) {
            return coupon.code;
        });
        requestModel.coupons = JSON.stringify(coupons);

        return requestModel;
    }
636109
public ApplicationReportIndexModel getApplicationReportIndexForProjectModel(ProjectModel projectModel)
    {
        GraphTraversal<Vertex, Vertex> pipeline = new GraphTraversalSource(getGraphContext().getGraph()).V(projectModel.getElement());
        pipeline.in(ApplicationReportIndexModel.APPLICATION_REPORT_INDEX_TO_PROJECT_MODEL);

        ApplicationReportIndexModel applicationReportIndex = null;
        if (pipeline.hasNext())
        {
            applicationReportIndex = frame(pipeline.next());
        }
        return applicationReportIndex;
    }
564857
public com.google.api.ads.adwords.axis.v201809.cm.AppPaymentModelAppPaymentModelType getAppPaymentModelType() {
        return appPaymentModelType;
    }
940078
public ApiResponse<ModelApiResponse> pingWithHttpInfo() throws ApiException {
        com.squareup.okhttp.Call call = pingValidateBeforeCall(null, null);
        Type localVarReturnType = new TypeToken<ModelApiResponse>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }
813971
public static AlipayFundCouponOrderRefundResponse fundCouponOrderRefundToResponse(
			AlipayFundCouponOrderRefundModel model) throws AlipayApiException {
		AlipayFundCouponOrderRefundRequest request = new AlipayFundCouponOrderRefundRequest();
		request.setBizModel(model);
		return AliPayApiConfigKit.getAliPayApiConfig().getAlipayClient().execute(request);
	}