Where are are IdentityUsers uploaded to the database? - entity-framework

I have created a ASP.net core web app with user authentication. The user authentication has been auto-implemented and it works like a charm. However, I need to do 2 things:
-Add a text field 'Name' to the user registration
-Write a record into another (custom-made) table when AspNetUsers is written to.
However, I can't seem to find where (meaning in what file/method) either of these things can be done.
I tried and debugged the web app, but it didn't help.
As I expect that IdentityUsers are written to the data base using DbContext.Add, I also searched for that but didn't help either.
Thank you in advance.

The following article explains everything: https://learn.microsoft.com/en-us/aspnet/core/security/authentication/scaffold-identity?view=aspnetcore-2.1&tabs=visual-studio .

Related

Why snipcart digital goods verification fails

I’ve been stuck on this for a while now.
I’m trying to set up a digital products webshop, using Vue + Strapi + Snipcart.
Here’s the error I’m encountering once I try to checkout with a product:
browser error message from snipcart
However, If I test with a normal product that doesn’t have guid attached to it - everything is fine and the transaction goes through.
I use snipcart’s JSON crawler. Therefore I’ve created an endpoint from my API with all products.
JSON structure
{
"_id":"618ff1327f4e2824f09134cf",
"price":123,
"file_guid":"7571fd60-a403-404c-b27a-616c0856e1ee",
"id":"618ff1327f4e2824f09134cf"
}
...
The only thing that comes to my mind - is that I’m not correctly referencing guid in my JSON document
I’ve also tried just guid instead file_guid - it didn’t work.
Lastly this is my “Add to cart” button code:
<v-btn dark depressed class="mt-5 snipcart-add-item"
:data-item-id="productDetails.id"
:data-item-description="productDetails.shortDescription"
:data-item-price="productDetails.price"
:data-item-image="apiUrl + productDetails.image.url"
:data-item-name="productDetails.title"
:data-item-url="'https://92ef-91-101-56-233.ngrok.io/products/snipcart'"
:data-item-max-quantity="1"
:data-item-min-quantity="1"
:data-item-file-guid="productDetails.file_guid"
>ADD TO CART</v-btn>
Everything is running and tested locally using ngrok.
Does anyone have any ideas of what I’m doing wrong? Any help is highly appreciated.
Thanks.
I’ve managet to figure out the issue. As I suspected I was referencing guid wrong (file_guid and guid), that’s why snipcart’s JSON crawler was returning me the error.
I’ve found in some random repository that You must use the name fileGuid in your API otherwise crawler won’t find it.

Parse Signup Problems

So, I wanted to create a new social media app using Swift and Parse. When I go to the Parse site, and click on dashboard, it gives me a login screen. I don't have an account, so I click on the "I don't have a parse account" button. When I click on that, it just takes me back to the home page. I did manage to get the code and frameworks and stuff that I needed from the docs, but that didn't quite work. It gave me this for the initialize code:
let configuration = ParseClientConfiguration {
$0.applicationId = "YOUR_APP_ID"
$0.server = "http://YOUR_PARSE_SERVER:1337/parse"
}
In the tutorial I'm watching, rather than "YOUR_APP_ID" and "http://YOUR_PARSE_SERVER:1337/parse" it just had a bunch of letters and numbers, which I would assume are the app ID and Parse server. My guess is, that I need an account to get those. Would that be correct? And, does anyone know why I can't seem to get an account? Thanks.
Parse.com is shutting down, so that's why you are not allowed to create new accounts on the service. Check the blog post.
They open sourced a nodeJS implementation, which you should definitely check out at link, and here is an example to get you started. You can easily use the deploy buttons to host the server on services like Heroku, AWS, Azure, etc. You can also deploy a server locally, for testing purposes.
Although it's true that Parse is discontinuing early next year, you can still setup a new app if you want to use the service for a shorter term project. Replace your code with the following.
Parse.setApplicationId("YOUR-APP-ID", clientKey: "YOUR-CLIENT-ID")
You can find your App ID and Client ID in your app's settings > security & keys.
EDIT: You definitely need an account for this to work.

Getting quizzes from Moodle

I'm trying to get Moodle's quizzes as JSON. I've already tried
http://desenvolvimento.imd.ufrn.br/qmmoodle/webservice/rest/server.php?wstoken=cf5a6639a4431341a40e7a75d8bb9cba&wsfunction=get_quizzes_by_course&moodlewsrestformat=json&course_id=2
To get all quizzes from a specific course. And
http://desenvolvimento.imd.ufrn.br/qmmoodle/webservice/rest/server.php?wstoken=cf5a6639a4431341a40e7a75d8bb9cba&wsfunction=get_quiz&moodlewsrestformat=json&quiz_id=3
To get a specific quiz.
I don't know what is wrong in my URL.
Thanks.
I think that you are referring to this document. If you read closely, you'll notice that it's a proposal about how the quiz web service should be written.
In fact, when I tried your query, to get all quizzes from a course, I got:
{"exception":"dml_missing_record_exception","errorcode":"invalidrecord",
"message":"Can not find data record in database table external_functions.",
"debuginfo":"SELECT * FROM {external_functions}
WHERE name = ?\n[array (\n 0 => 'get_quiz',\n)]"}
Moodle didn't found the external function get_quiz. That means... unfortunately, as of now, Moodle does not have a web service for quizzes.
If you feel adventurous, and what you need is just getting the quizzes, you could implement a web service to do that. The relevant moodle table about quizzes is mdl_quiz (for a full schema, look at this article), and here's the tutorial that shows how to implement it: Adding a web service to a plugin - Moodle Docs.
mod_quiz_get_quizzes_by_courses
is the function that does the job. How to call it
https://yourmoodledomain/webservice/rest/server.php?moodlewsrestformat=json&courseids[0]=courseid&wsfunction=mod_quiz_get_quizzes_by_courses&wstoken=yourusertoken

Codeigniter Facebook app POST method AND query_string

I have a toy facebook app I'm playing with so I can understand how it all works. It's fine if you go the the app like this: http://apps.facebook.com/pushup-challenge/ (and connect it). But if you then go to it from your facebook page, FB uses the URL http://apps.facebook.com/pushup-challenge/?ref=bookmarks.
In my log file, I see that FB is POSTing the data and including the /?ref=bookmarks to it's call to my codeigniter system. This is causing it to either say "invalid URI parameters" or give me a 404, depending on if I've edited the system/core/URI.php file to add rawurlencode() to a particular call.
I've tried using mod_rewrite to get rid of the query_string, too, but since it's POSTing, it doesn't appear to be working (though I'm not exactly sure why).
Has anyone else run into this? How did you fix it?
Thanks in advance,
Hans
try $config['uri_protocol'] = “PATH_INFO”; and set enable_query_strings = TRUE
or
set
$config['permitted_uri_chars'] = 'a-z 0-9~%.:_\-?=';
in config.php
Because it isn't calling your file by name (just ?ref=bookmarks) the server runs thru the standard default files: index.htm, index.html, index.asp. Because you need to accept a POST, you need a server that allows POSTs to htm & html if you choose to use those. Index.asp will accept POSTs on most servers, and that works for me.
SOLUTION: Add a file (index.asp), that calls the real app that you named in the App settings.

Need help with Zend Framework dynamic Namespaces

I want to make my system redirect unknown requests such as
www.address.com/a_company
to the adress
www.address.com/companies/company/ and display the company a_company if it exists in the database, otherwise throw the user to a 404 not found page.
So in detail, I want to make namespace that is as the first example dynamically, if the company exist in the database, I have no problem connecting to the database and retrieving information or finding a way to parse a company name, I just need help how to make my system check and run a function every time the address doesn't exist and show the second page (/companies/company/)..
I am using an Acl as well, but I think it should be fine if the page is /companies/company and then possibly add /?c=a_company or similar.
Thank you.
/Marcus
simply create a front controller plugin which checks the request params agains the database before the request is dispatched.