public virtual async Task <string> Verify(VerifyRequestDto input) { var options = await _optionsResolver.ResolveAsync(); if (_signatureChecker.Validate(options.Token, input.Timestamp, input.Nonce, input.Signature)) { return(input.EchoStr); } return("非法参数。"); }
/// <summary> /// 登录凭证校验。通过 wx.login 接口获得临时登录凭证 code 后传到开发者服务器调用此接口完成登录流程。 /// </summary> /// <param name="code">登录时获取的 code</param> /// <param name="grantType">授权类型,此处只需填写 authorization_code</param> public async Task <Code2AccessTokenResponse> Code2SessionAsync(string code, string grantType = "authorization_code") { var options = await _optionsResolver.ResolveAsync(); return(await Code2SessionAsync(options.AppId, options.AppSecret, code, grantType)); }
public virtual async Task <string> GetAccessTokenAsync() { var options = await _weChatOfficialOptionsResolver.ResolveAsync(); return(await _accessTokenProvider.GetAccessTokenAsync(options.AppId, options.AppSecret)); }