Alexa location permission request is not working - alexa

Whenever I request a location permission in the alexa simulator, the simulator does not respond.
I use the code snippet below.
How does the intent look like to process the response?
conv._alexaContext!.response.speak(reasonForLocationPermissionText + ', muss ich zuerst deinen aktuellen Standort aus deinem Alexa‐Konto abrufen. Bist du damit einverstanden?')
const permissions = ['read::alexa:device:all:address']
conv._alexaContext!.response.askForPermissionsConsentCard(permissions)
conv._alexaContext!.emit(':responseReady')

Related

Unable to load 'eeptools' package in R

After an update that I needed for another package, I can no longer use 'eeptools' to calculate the age. When I try, I always get the following error message:
Fehler: Laden von Paket oder Namensraum für ‘eeptools’ in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]): fehlgeschlagen
es gibt kein Paket namens ‘minqa’
I have already tried deleting the package from the location and reinstalling it. Loading the "Minqa" package also failed.
I am grateful for any tips!

How to group types.SHUTTER like types.LIGHT

I'm developing Smart Home actions for controling roller shutter devices through google home/assistant.
I have shutters in all rooms of my house, and can have several shutters in the same room. Individual control of each of my shutters works well.
But I'd like to request "close all the shutters of the kitchen", or "close all the shutters of all rooms" but Google does not recognize the intent.
Is there a way to group my devices (like the types.LIGHT) ? Or something else I can do ?
Thx,
Dam
Ok understood. Seems to be a problem with the french language :
"Hey Google, close the small shutter" --> OK
"Ok Google, close the big shutter" --> OK
"Ok Google, open the shutters" --> OK
"Ok Google, ferme le petit volet" --> OK
"Ok Google, ferme le grand volet" --> OK
"Ok Google, ouvre les volets" --> KO "Je n'arrive pas à déterminer l'appareil les volets que vous voulez controler" (translate = unable to determine which device you want to control)
What can I do ?

(iOS) Success to get token, but cannot get the result from web API when the app opening the second time

I am using ADAL 2.4.1(for iOS). The app gets the token successfully after login the Azure AD and able to use the token for calling the web API and getting the data. However, I quitted/ killed the app and open the app again. The app still can get the token, but it cannot get the data from the web API. The server would return an HTML script to the app.
The app would log in the Azure AD to get the access token and store it in the app (using the keychain). I will use the stored access token to call the API.
A function to get the API:
ADAuthenticationContext *authContext = [ADAuthenticationContext authenticationContextWithAuthority:AUTHORITY_URL error:nil];
authContext.credentialsType = AD_CREDENTIALS_AUTO;
NSURL *redirectUri = [[NSURL alloc]initWithString:REDIRECT_URI];
[authContext acquireTokenWithResource:"api_path"
clientId:CLIENT_ID
redirectUri:redirectUri
promptBehavior:AD_PROMPT_AUTO
userId:nil
extraQueryParameters: #""
completionBlock:^(ADAuthenticationResult *result)
{
if (result.status != AD_SUCCEEDED)
{
completionBlock(nil, nil, result.error);
}
else
{
completionBlock(result.tokenCacheItem.userInformation, result.tokenCacheItem.accessToken, nil);
}
}];
A function to get the data form WebAPI :
NSURL *url=[NSURL URLWithString:"API Path"];
NSData *postData = [post dataUsingEncoding:NSASCIIStringEncoding allowLossyConversion:YES];
NSString *postLength = [NSString stringWithFormat:#"%lu", (unsigned long)postData.length];
[[NSURLCache sharedURLCache] removeAllCachedResponses];
NSMutableURLRequest *request = [NSMutableURLRequest new];
[request setURL:url];
[request setHTTPMethod:#"POST"];
[request setTimeoutInterval: 15];
[request setValue:postLength forHTTPHeaderField:#"Content-Length"];
[request setValue:#"application/json" forHTTPHeaderField:#"Accept"];
[request setValue:#"application/x-www-form-urlencoded" forHTTPHeaderField:#"Content-Type"];
NSString* authValueToken = [NSString stringWithFormat:#"Bearer %#", "ADAL Token"];
[request setValue:authValueToken forHTTPHeaderField:#"Authorization"];
[request setHTTPBody:postData];
[NSURLConnection sendAsynchronousRequest:request queue:opsQueue completionHandler:^(NSURLResponse *response, NSData *data, NSError *error)
{
NSString* resultString = [[NSString alloc] initWithData:data encoding:NSASCIIStringEncoding];
NSLog(#"result : %#", resultString);
Start app at the first time, the app needs to login Azure AD or using another app "Microsoft Authenticator" to get the token. It is successful to get token and get the data from web API. Also, the app would store the token in the app (using keychain).
Start app at the second time, since I select AD_PROMPT_AUTO in the function "acquireTokenWithResource". The app would automatically check if the token(store in the keychain) is expired first. If not expired, it would be using this token to call the API. However, the server returns an HTML script to the app. This HTML script is same as a login page.
HTML script:
Sign in to your account
<noscript>
<meta http-equiv="Refresh" content="0; URL=https://login.microsoftonline.com/jsdisabled" />
</noscript>
<link rel="shortcut icon" href="https://secure.aadcdn.microsoftonline-p.com/ests/2.1.8383.13/content/images/favicon_a_eupayfgghqiai7k9sol6lg2.ico" />
<meta name="robots" content="none" />
https://login.live.com/logout.srf?iframed_by=https%3a%2f%2flogin.microsoftonline.com","urlUxPreviewOptOut":"https://login.microsoftonline.com/common/uxpreview/optout","showCantAccessAccountLink":true,"fShowAsyncTileLoad":true,"urlFeatureAnnouncementBlogPost":"https://aka.ms/AA1edlw","fCollapseExcessLinks":true,"fShowLoginV2PreviewLink":true,"fEnableShowResendCode":true,"iShowResendCodeDelay":90000,"sSMSCtryPhoneData":"AF~Afghanistan~93!!!AX~Ã…land.....
It is likely that the API you are trying to access does not identify the request as an authenticated request, and is redirecting the client to sign in with Azure AD. This behavior is somewhat strange, but could be explained if the API is also an endpoint which can be visited in a browser.
It is possible that your client (the mobile app) is not sending the access token correctly in the request. In you code, you have the following line:
NSString* authValueToken = [NSString stringWithFormat:#"Bearer %#", "ADAL Token"];
If that is actually what you have in your app's code, then you would need to update this to actually use the access token (obtained from ADAL) in the Authorization header, not the string "ADAL Token".

Interface Between Google Sign-in and MailKit

I am writing an app in WPF (Windows 10 desktop) that should
include a component where the user can download message headers
and messages from G-Mail.
I am trying to use MailKit to interface with G-Mail via a secure
connection (without having to turn on "allow less-secure apps"
for G-Mail) and download messages with POP3. I am a bit confused
as to the proper procedure.
FYI: I know next to nothing about OAuth and TLS, so KISS please.
I have created and downloaded a JSON file for OAuth 2.0 from Google.
I have visited the FAQ for MailKit, and the following section
seems relevant, but I'm not sure as to what I should plug in
to the interface.
(Please see the code below.)
For "password", would that be the password for the account?
I'm not sure as to what to give for
"your-developer-id#developer.gserviceaccount.com".
.........................................................
https://github.com/jstedfast/MailKit/blob/master/FAQ.md#ProtocolLog
.........................................................
From the Q & A:
How can I log in to a GMail account using OAuth 2.0?
The first thing you need to do is follow Google's instructions for
obtaining OAuth 2.0 credentials for your application.
Once you've done that, the easiest way to obtain an access token is to
use Google's Google.Apis.Auth library:
var certificate = new X509Certificate2 (#"C:\path\to\certificate.p12", "password",
X509KeyStorageFlags.Exportable);
var credential = new ServiceAccountCredential (new ServiceAccountCredential
.Initializer ("your-developer-id#developer.gserviceaccount.com") {
// Note: other scopes can be found here: [links]
Scopes = new[] { "https mail google com " },
User = "username#gmail.com"
}.FromCertificate (certificate));
bool result = await credential.RequestAccessTokenAsync (CancellationToken.None);
// Note: result will be true if the access token was received successfully
// Now that you have an access token (credential.Token.AccessToken), you can
// use it with MailKit as if it were the password:
using (var client = new ImapClient ()) {
client.Connect ("imap.gmail.com", 993, true);
// use the access token as the password string
client.Authenticate ("username#gmail.com", credential.Token.AccessToken);
}
My next question: Would the user be able to access their own account(s)
with my app without having to follow the same procedure?
IOW: Will the credentials that I've downloaded work for any account?
... or allow access only to the account from which the credentials
were created?
If the credentials are only good for my own account, then I'll have to
do something else.
Would Google Sign-In be a better approach?
I've downloaded the example code for .NET from Google:
https://github.com/googlesamples/oauth-apps-for-windows
I've built and ran ran "OAuthConsoleApp", as well as "OAuthDesktopApp".
It would seem that I am getting a secure connection from those,
as I have gotten the following output:
.........................................................
redirect URI: http 127.0.0.1:64003
Listening..
Authorization code: qwerty ...
Exchanging code for tokens...
Send the request ...
GetRequestStream ...
await stream.WriteAsync ...
Get the response ...
responseText ...
{
"access_token": "qwerty ...",
"token_type": "Bearer",
"expires_in": 3600,
"refresh_token": "qwerty ...",
"id_token": "qwerty ..."
}
Making API Call to Userinfo...
+++ userinfoResponseText : {
"sub": "117108120545711995673",
"name": "My Name",
"given_name": "My",
"family_name": "Name",
"picture": "qwerty ...",
"locale": "en"
}
.....................................................
I see that I have an "access_token" in the response and I thought
that I could plug that in to the "client.Authenticate" method for
MailKit as the password (as mentioned in the docs for MailKit):
string access_token = tokenEndpointDecoded["access_token"];
client.Connect ("pop.gmail.com", 995, SecureSocketOptions.SslOnConnect);
client.Authenticate ("username#gmail.com", access_token);
It threw an exception:
.....................................................
"POP3 server did not respond with a +OK response to the AUTH command."
at MailKit.Net.Pop3.Pop3Client.Authenticate(Encoding encoding,
ICredentials credentials, CancellationToken cancellationToken)
at MailKit.MailService.Authenticate(String userName, String
password, CancellationToken cancellationToken)
at
NS_MailKit_01.Pop3.cls_mailKit_Pop3_01.connect_and_authenticate(Object
p3_client, String p_access_token)
in :\Software_Develpoment_Sys_03_K\MIME_EMail\TEST_02\Mail_Kit_01\MailKit_01.cs:line
465
at
LIB1_01_G_Mail_Auth.cls_G_mail_authorization.str_token_NTRF.invoke_access_token(String
p_access_token)
in K:\Software_Develpoment_Sys_03_K\MIME_EMail\TEST_02\OAuth\oauth-apps-for-windows\OAuthConsoleApp\LIB1_01_G_Mail_Auth\G_Mail_Auth_01.cs:
line 95
at
LIB1_01_G_Mail_Auth.cls_G_mail_authorization.d__13.MoveNext()
in K:\Software_Develpoment_Sys_03_K\MIME_EMail\TEST_02\OAuth\oauth-apps-for-windows\OAuthConsoleApp\LIB1_01_G_Mail_Auth\G_Mail_Auth_01.cs:line
343
.....................................................
Does anyone know how I could get a "credential" object from
the Google interface that I could use with MailKit?
Any help would be appreciated.
Thanks!
For "password", would that be the password for the account?
No. It would be the password for your PKCS12 file containing your X.509 Certificate and your private key.
I'm not sure as to what to give for "your-developer-id#developer.gserviceaccount.com".
You need to register yourself and your application with Google's Developer program which will give you a developer id to use. You need to follow their directions.

Global Exceptionhandler does not catch some Exception (for example StackoverflowException)

I have registered global Exceptionhandlers in my Application (C#, WPF, .NET4) at the startup-routine on the following way:
AppDomain.CurrentDomain.UnhandledException += (sender, args) => HandleException(args.ExceptionObject as Exception);
Application.Current.DispatcherUnhandledException += (sender, args) => {
HandleException(args.Exception);
args.Handled = true;
};
Where HandleException() does logging the Exception and showing a MessageBox with some additional information.
Now, there are from time to time crashes of my application on some customer machines, where HandleException() is not called. Windows is showing the following message:
In the WindowsEventLog, I get the following entries:
Entry1:
Name der fehlerhaften Anwendung: proconact.exe, Version: 1.0.0.1365, Zeitstempel: 0x511531df
Name des fehlerhaften Moduls: PresentationFramework.ni.dll, Version: 4.0.30319.588, Zeitstempel: 0x504db27d
Ausnahmecode: 0xc00000fd
Fehleroffset: 0x002ef05b
ID des fehlerhaften Prozesses: 0x1bec
Startzeit der fehlerhaften Anwendung: 0x01ce0b5dce4030a6
Pfad der fehlerhaften Anwendung: C:\Program Files (x86)\proconact_sck\proconact.exe
Pfad des fehlerhaften Moduls: C:\windows\assembly\NativeImages_v4.0.30319_32\PresentationFramewo#\c627e9b7f10b01db43645284e601f255\PresentationFramework.ni.dll
Berichtskennung: d8d69f94-777a-11e2-b4b0-b4b52f2aad4f
Entry2:
Fehlerbucket 3482664247, Typ 5
Ereignisname: CLR20r3
Antwort: Nicht verfügbar
CAB-Datei-ID: 0
Problemsignatur:
P1: proconact.exe
P2: 1.0.0.1365
P3: 511531df
P4: PresentationFramework
P5: 4.0.0.0
P6: 504db27d
P7: 329d
P8: 0
P9: System.StackOverflowException
P10:
Angefügte Dateien:
d:\Temp\WER6E9F.tmp.WERInternalMetadata.xml
Diese Dateien befinden sich möglicherweise hier:
C:\Users\roger\AppData\Local\Microsoft\Windows\WER\ReportArchive\AppCrash_proconact.exe_b0fabce1f86d1f843de5b5b4692a3e8ecd928_2c77f03d
Analysesymbol:
Es wird erneut nach einer Lösung gesucht: 0
Berichts-ID: d8d69f94-777a-11e2-b4b0-b4b52f2aad4f
Berichtstatus: 0
What can I do that I can handle the Exception (for the meanreason to get the stacktrace for analysis where the exception occurs)?
Some exceptions cannot be caught, not even by AppDomain.UnhandledException. Because they are too nasty to permit managed code to keep running.
StackOverflowException is heart attack like that, infamous enough to give this web site its name. There is not enough stack space left to do common managed code execution duties, like running the jitter. ExecutionEngineException is another one, triggered by a destroyed garbage-collected heap and uncatchable in .NET 4.0 and up.
So no, the show is over and the WER dialog and the Windows event log entry is all that's left to look at. SO is always caused by a bug, you'll need to fix it.

Resources