No Role found with id: 106 (HTTP 404) in Keyrock when creating new application - fiware

I have a problem when creating new application in Horizon(Identity manager GE).
Im logged in as idm user and when creating application, on the first step when i specify name, description, callback and url and press next i get following error:
Error: No Role found with id: 106 (HTTP 404)
Error: Unable to register the application.
What might be the problem?

The mistake was in the Horizons local_settings.py file.
instead of attributes FIWARE_PURCHASER_ROLE_ID and FIWARE_PROVIDER_ROLE_ID pointing to corresponding row ids of table role_fiware like this:
FIWARE_PURCHASER_ROLE_ID = '5786623590bc4f3ab01c61733a13ee6d'
FIWARE_PROVIDER_ROLE_ID = '4806909eb4b646c7a1f11ad9f9ed53ed'
attributes were :
FIWARE_PURCHASER_ROLE_ID = '106'
FIWARE_PROVIDER_ROLE_ID = '191'
I guess that is default configuration for sqlite db.
So if using mysql db just insert correct ids in this file for these attributes from table role_fiware.

Related

Creating an activity alias returns either 404 or 400

I have just created an activity with the name of InventorParams. I would like to add an alias as right now it shows up as: Guasamt.InventorParams+$LATEST in the activities list.
Now when POSTing the following request:
[
"id" => "prod"
]
Laravel will turn this into json. The Authorization header is also present
to https://developer.api.autodesk.com/da/us-east/v3/activities/:id/aliases. It either returns 400 or 404 errors. The 400 error is presented when using a fully qualified activity name. The 404 error is returned on all of the the following activity names:
Guasamt.InventorParams+LATEST (without $);
Guasamt.InventorParams;
InventorParams;
Now I'm wondering what should be the unqualified name of an activity?
When you create an Activity in FDA it gets a version number (since you just created it, it would be 1). This number needs to be used when creating Activity Alias, which is later used in the Work Item.
Your fully qualified name consist of <your_nick_name>.<activity_name>+<activity_version>. Where <your_nick_name> can be your ClientId if nickname was not specified.
Anyway I would recommend to follow the FDA tutorial. Another option on how to get quickly up to speed with FDA is to use the Autodesk Forge Tools addin to VS Code.

(Microsoft Dynamics Online) Get Account GUID inside embedded Web Resource

I'm trying to access entities (Contacts) in a HTML WebResource inside an Account formular in Microsoft Dynamics. However I cannot figure out how to get the record GUID (accountId) from the PageContext. It tells me the entityId is undefined.
I'm trying to replace this deprechated code line:
const accountId = parent.Xrm.Page.data.entity.getId();
I've been trying to use
const pageContext = window.parent.Xrm.Utility.getPageContext();
but the attributes are almost all null or undefined including the entityId. All it tells me is that I'm in an account record. See image. https://imgur.com/a/oeA1SOz
Thanks for any help
Yes is possible, you were close in your second attempt.
This will return the id:
var id = parent.Xrm.Utility.getPageContext().input.entityId.replace("{", '').replace("}", '');
From Microsoft docs:
Pass parameters to HTML web resources

Firebase web authenticate and add to database

I am stuck on this and the other posts I have read on here are not useful. So I've reached a point where i need to ask for help after many hours on not resolving what I feel should be a simple task. I program in Swift usually and really know little about html or javasript.
I am building a simple webpage to log-in to Firebase and a second linked page to upload data to a database. Both work fine. The problem is getting the uploaded data to link to the uid of the current user.
So I am logged into an existing user with it's own uid. How do I then upload the data to the current user did in the database? Should be simple but I am just not getting it :-(
Code for uploading data is as follows (note I have tried using both set and push):
// Generate a reference to a new location and add some data using push()
var postsRef = ref.child("users");
var newPostRef = postsRef.push({
// var newPostRef = postsRef.set({
name: _name,
property: _property,
email: _email,
phone: _phone,
Any help, or better still a working simple example would be useful. I have read the docs on Firebase, so please don't direct me there :-)
Many thanks in anticipation
It is a best practice to create a new database node using the UID generated by the account creation as the path after /users.
Right now, when you push data into /users, Firebase creates a uid for that particular array item that does not correspond to the UID of the user.
If you use set, you need to specify the path you will set which should include the long UI: /users/longGUIDhere
You can get the user id with something like this (from Firebase docs):
var user = firebase.auth().currentUser;
var name, email, photoUrl, uid;
if (user != null) {
name = user.displayName;
email = user.email;
photoUrl = user.photoURL;
uid = user.uid; // The user's ID, unique to the Firebase project. Do NOT use
// this value to authenticate with your backend server, if
// you have one. Use User.getToken() instead.
}
And then you shouuld use uid to populate the path like below to save their info:
function writeUserData(userId, name, email, imageUrl) {
firebase.database().ref('users/' + userId).set({
username: name,
email: email,
profile_picture : imageUrl
});
}
I know you asked not to be referred to the Firebase docs, but it also looks like you are using an older version of the SDK, so that could be part the issue as well. I recommend taking a look at these two page, since that is where I pulled these verbatim examples:
https://firebase.google.com/docs/database/web/read-and-write
https://firebase.google.com/docs/auth/web/manage-users
var postsRef = ref.child("users/current user id or json key");
this will help you to update the details of current user.

using botov1.8d to work with Amazon MechanicalTurk

I'm new to amazon MTurk, and I'm trying to create hits and fetch results through boto v-1.8d. However, this has brought up a lot of issues and I'm wondering if this is because I'm using an older version of boto.
Note: I can't use the latest release since this is my way of learning how to work with MTurk to implement an open source application called CrowdForge, which is only compatible with boto v1.8d.
If you know of any sample code for 1.8d and/or tutorials, I'd appreciate it if you share the link.
For example: One think im confused about is that the result of the following code is empty brackets "[]" instead of showing a value such as [10000].
#import classes needed from boto library
from boto.mturk.connection import MTurkConnection
#specify your own access key and secret access key
ACCESS_ID = 'myAccessKey'
SECRET_KEY = 'mySecretKey'
HOST = 'mechanicalturk.amazonaws.com'
SECURE = True
#make a connection
mtc = MTurkConnection(aws_access_key_id = ACCESS_ID,
aws_secret_access_key = SECRET_KEY,
host = HOST,
is_secure = SECURE)
#display the account balance
print mtc.get_account_balance()

Linq 2 SQL on shared host

I recently ran into an issue with linq on a shared host.
The host is Shared Intellect and they support v3.5 of the framework. However, I am uncertain to whether they have SP1 installed. My suspicion is that they do not.
I have a simple News table that has the following structure:
NewsID uniqueidentifier
Title nvarchar(250)
Introduction nvarchar(1000)
Article ntext
DateEntered datetime (default getdate())
IsPublic bit (default true)
My goal is to display the 3 most recent records from this table. I initially went the D&D method (I know, I know) and created a linq data-source and was unable to find a way to limit the results the way I desired, so I removed that and wrote the following:
var dc = new NewsDataContext();
var news = from a in dc.News
where a.IsPublic == true
orderby a.DateEntered descending
select new { a.NewsID, a.Introduction };
lstNews.DataSource = news.Take(3);
lstNews.DataBind();
This worked perfectly on my local machine.
However, when I uploaded everything to the shared host, I recieved the following error:
.Read_<>f__AnonymousType0`2
(System.Data.Linq.SqlClient.Implementation.ObjectMaterializer`1<System.Data.SqlClient.SqlDataReader>)
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.MethodAccessException:
.Read_<>f__AnonymousType0`2
(System.Data.Linq.SqlClient.Implementation.ObjectMaterializer`1<System.Data.SqlClient.SqlDataReader>)
I tried to search the error on Google, but met with no success. I then tried to modify my query in every way I could imagine, removing various combinations of the where/orderby parameters as well as limiting my query to a single column and even removing the Take command.
My Question therefore comes in 3 parts:
Has anyone else encountered this and if so, is there a "quick" fix?
Is there a way to use the datasource to limit the rows?
Is there some way to determine what version of the framework the shared host is running short of emailing them directly (which I have done and am awaiting an answer)
System.MethodAccessException is thrown by the framework when it is missing an assembly, or one of the references are of the wrong version.
The first thing I would do is try uploading and referencing your code to the LINQ assemblies in your BIN, instead of the shared hosting providers GAC.