我在 DidCompleteWitherror 中收到以下错误:
com.apple.AuthenticationServices.Authorization Error Code 1000
Run Code Online (Sandbox Code Playgroud)
我正在使用以下代码登录 Apple
var appleIdProvider = new ASAuthorizationAppleIdProvider();
var request = appleIdProvider.CreateRequest();
request.RequestedScopes = new ASAuthorizationScope[] { ASAuthorizationScope.Email, ASAuthorizationScope.FullName };
var authController = new ASAuthorizationController(new[] { request });
authController.Delegate = this;
authController.PresentationContextProvider = this;
authController.PerformRequests();
...
[Export("authorizationController:didCompleteWithAuthorization:")]
public void DidComplete(ASAuthorizationController controller, ASAuthorization authorization)
{
...
}
[Export("authorizationController:didCompleteWithError:")]
public void DidComplete(ASAuthorizationController controller, NSError error)
{
...
}
Run Code Online (Sandbox Code Playgroud)
这个错误的原因可能是什么?
xamarin.ios xamarin xamarin.forms visual-studio-mac apple-sign-in
我正在尝试使用 iOS 应用程序和后端实现使用 Apple 登录。目标是这样的:
authorizationCode
authorizationCode
通过另一个对苹果服务器的调用来验证。在这里我很困惑。为了进行这个调用,后端需要提供一堆参数:
网址
https://appleid.apple.com/auth/token
Run Code Online (Sandbox Code Playgroud)
查询参数
client_id = com.mycompany.appname
client_secret = ...
code = ... // `authorizationCode` from the signin in the iOS app
grant_type = authorization_code
Run Code Online (Sandbox Code Playgroud)
我已经产生JWT
了client_secret
:
JWT 属性
header:
kid: <key id, created on Apple Dev Portal>
claims:
iss: <team id>
iat: <current timestamp>
exp: <current timestamp + 180 days>
aud: "https://appleid.apple.com"
sub: "com.mycompany.appname"
Run Code Online (Sandbox Code Playgroud)
昨天我在 Dev Portal 上为两个应用程序(A 和 B)创建了两个密钥,用它来生成秘密,今天应用程序 A …
我正在尝试使我的应用程序(适用于Windows 10)在.NET native下运行.
我遇到了以下问题:Enum.GetValues
在运行时失败,缺少元数据.我设法简化了这个问题的测试用例(在现实生活中我的代码看起来不同).在便携式库中,我有:
public enum enumValues
{
A1,
B1,
C1,
}
public class fff
{
public static object GetClass2Value()
{
return enumValues.B1;
}
}
Run Code Online (Sandbox Code Playgroud)
在我的通用Windows应用程序中,我调用以下代码:
Array aaa = Enum.GetValues(fff.GetClass2Value().GetType());
Run Code Online (Sandbox Code Playgroud)
我收到以下异常:
附加信息:'enumlibportable.enumValues []'缺少元数据.
问题是我不知道要添加到Default.rd.xml的内容.我试图使用微软工具http://go.microsoft.com/fwlink/?LinkID=392859添加不同的rd字符串(enum subtype,enumValues类,enumValues []等),但没有运气.
更新:我知道以下代码适用于我的测试用例Enum.GetValues(typeof(enumValue))
,但我不能在我的真实项目中使用它,因为我不知道我的实际项目中的确切枚举类型.
有没有办法自动化Windows商店的包构建?(我在构建服务器上使用jenkins)我想在构建服务器上没有用户交互的情况下为Windows应用商店准备包.电子邮件验证码,构建.NET本机和认证应用套件的东西和所有GUI的东西需要花费太多时间,我想自动化这个过程.我想知道它是否可能.
根据MS文档,Sync Framework Toolkit(https://code.msdn.microsoft.com/Sync-Framework-Toolkit-4dc10f0e)是MS不再支持的传统开源产品:
https://msdn.microsoft.com/en-us/library/jj839436(v=sql.110).aspx
这没关系,但是Microsoft Sync SDK如何不是开源的呢?这是否意味着开源部分无用,因为将来MS可以删除服务器部分?
如何迭代 OData 元数据?我需要迭代所有实体及其属性,包括类型、键和导航属性(准确地说是所有可用信息),但由于 SchemaElements 返回内部类型的对象 (Microsoft.OData.Edm.Csdl.CsdlSemantics.CsdlSemanticsEntityContainer) 和我无法投射它们来获取所有这些信息。
var metadata = await _client.GetMetadataAsync();
foreach(metadata.SchemaElements 中的 var 元素)
客户以这种方式声明的地方:
Simple.OData.Client.ODataClient _client;
我按照以下博客文章实现了 Apple 登录。这是很久以前写的,当时没有带有用户信息的 id_token。当我请求令牌 API 时,我收到带有多个字段的 JSON。问题是如何解码 id_token 字段中的数据以获取电子邮件地址和用户 ID。
我收到以下错误消息
服务实现对象未初始化或不可用。 at CoreWCF.Dispatcher.TaskMethodInvoker.InvokeAsync(Object instance, Object[] input) at CoreWCF.Dispatcher.DispatchOperationRuntime.<>c__DisplayClass71_0.<<InvokeAsync>b__0>d.MoveNext() --- 从上一个位置开始的堆栈跟踪结束 - -- 在 CoreWCF.Dispatcher.DispatchOperationRuntime.InvokeAsync(MessageRpc rpc)
请找到以下代码供您参考。
启动.cs
public class Startup
{
public void ConfigureServices(IServiceCollection services)
{
services.AddServiceModelServices().AddServiceModelConfigurationManagerFile("Web.config");
services.AddServiceModelMetadata();
services.AddSingleton<IServiceBehavior, UseRequestHeadersForMetadataAddressBehavior>();
services.AddLogging(loggingBuilder =>
{
loggingBuilder.SetMinimumLevel(LogLevel.Information);
loggingBuilder.AddApplicationInsights("xxxxxxxxxxx930939xxxx");
});
services.AddSingleton<ILoggingContractResolver, LoggingContractResolver>();
IMapper mapper = SappoApiAutoMapperConfiguration.Configure().CreateMapper();
services.AddSingleton<IMessageStoreFactory, AzureBlobMessageStoreFactory>();
services.AddSingleton(mapper);
services.AddSingleton(typeof(IOutboundSappoLogger<>), typeof(OutboundSappoLogger<>));
services.AddSingleton<IBlobStorageSettingsHelper, BlobStorageSettingsHelper>();
services.AddSingleton<IBlobClientFactory, BlobClientFactory>();
services.AddSingleton<IServiceBusFactory>(ctx =>
{
return new ServiceBusFactory();
});
services.AddTransient<IShipperAsnService, ShipperAsnService>();
services.AddHttpContextAccessor();
}
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
app.UseServiceModel(serviceBuilder =>
{
serviceBuilder.AddService<ShipperAsnService>(serviceOptions => …
Run Code Online (Sandbox Code Playgroud) 有没有办法将类从外部(托管)程序集转换为特定的接口?
我的意思是,而不是打电话MethodInfo.Invoke(instance, parameters);
,做这样的事情
Assembly assembly = Assembly.LoadFrom(assemblyName);
System.Type type = assembly.GetType(typeName);
Object o = Activator.CreateInstance(type);
IYourType yourObj = (o as IYourType);
Run Code Online (Sandbox Code Playgroud)
UPDATE
我有一个带有已知接口的外部程序集,是的,我有一个程序集中引用的本地副本.检查显示o的类型为assembly.GetType(typeName);
c# ×6
uwp ×2
.net ×1
.net-6.0 ×1
.net-native ×1
apple-id ×1
asp.net-core ×1
casting ×1
corewcf ×1
ios ×1
jwt ×1
metadata ×1
oauth ×1
odata ×1
reflection ×1
sql-server ×1
windows-10 ×1
xamarin ×1
xamarin.ios ×1