My question is almost similar to one mentioned in 'Auth Provider with per-user Named Credential' (). I am trying to authenticate and make a API call when a new or existing Salesforce community users try to log in. The Authentication is provided by 3rd party (Cognito). So, the requirement is :  User to be authenticated using the 3rd party system for login. After successful authentication and before community page is displayed, the API call is to be made to 3rd party system to get more details about the user.  In order to achieve this:  Created an Open ID Connect Auth. Provider Use the registration handler on the Auth. Provider to create/link a new/existing user. Use a login flow for API call. Use Per User Identity Type Named Credential to make API calls.  No, where I am having issue is once the user has authenticated successfully, how do I allow the user to make API call without authenticating it again. I am getting the error: An Apex error occurred: System.UnexpectedException: You don't have permission to view this data, enter credentials for the named credential in your personal settings. Or ask your Salesforce admin for help. I believe this error is due to the fact that the user is not listed under 'Authentication setting for External Systems'. My requirement doesn't allow me to authenticate the user again, so how do I achieve this using either APEX or any other way?
I'm looking into using Named Credentials (spring '15) to simplify apex callouts to an external web service.  I actually thought, based on the documentation, that this would help, and I'm referring correctly to the Named Credential in my code and have also given my profile access to the NC, but I'm faced with this error when I do the callout:     System.UnexpectedException: You don't have permission to view this   data. Ask your administrator to set up authentication for the external   data source   This seems to say that NC are tied to the use of External Data Source, which is absolutely unrelated to what I want to do, and the documentation doesn't mention that they are a requirement.  Have any of you run into this error when testing out Named Credentials?
Why is energy in a wave proportional to amplitude squared? Given $a_1, a_2, a_3, \ldots , a_n$ not all zero, show $\gcd(a_1, a_2, a_3, \ldots , a_n)$ is the least positive integer that can be expressed in the form $a_1x_1+a_2x_2+ \ldots +a_nx_n$. Also deduce $a_1x_1+a_2x_2+ \ldots +a_nx_n = b$ has solutions $\iff \gcd(a_1, a_2, a_3, \ldots , a_n)|b$.   I know that $ax+by=n$ has integer solutions $\iff \gcd(a,b)|n$. I'll need to use induction to show $a_1x_1+a_2x_2+ \ldots +a_nx_n = \gcd(a_1, a_2, a_3, \ldots , a_n)$ has solutions, and then I will be able to say that as $\gcd(a_1, a_2, a_3, \ldots , a_n) | a_1x_1+a_2x_2+ \ldots +a_nx_n $ for any $x_1,x_2, x_3 \ldots x_n$ then $c \leq \gcd(a_1, a_2, a_3, \ldots , a_n)$ and $c \geq \gcd(a_1, a_2, a_3, \ldots , a_n)$, and thus $c=\gcd(a_1, a_2, a_3, \ldots , a_n)$. Don't show pending suggested edits to me after I run out of votes Now that I've reached 2k on Stack Overflow, I get access to the "Suggested Edits" review queue.  Although I only have 20 edits per day, the "suggested edit awaiting" icon in the top bar is always there and it bothers me a lot!  My suggestion is to apply one of three solutions:   Remove the suggested edits icon when we reach the maximum (50) edits Remove the Highlight (orange) on the suggested edits Remove the suggested edits part when we click on it   What do you think? Seeking QGIS tutorials and web resources? I wish to familiarize myself with the capabilities of QGIS up to and beyond QGIS version 3.0.   Can you recommend some good web resources and tutorials that would show me QGIS' capabilities?   I am interested in both using QGIS through its GUI and in developing applications using QGIS. Is "a total of 10 payments" singular or plural? A total of 10 payments were made.   OR     A total of 10 payments was made.   Which is correct? Or can both be correct? The company I work for has asked me to attend a training class on the other side of the country.  However my situation is my drivers license expired a few days ago. I do however have a separate printed email stating that the license has been renewed.  This drivers license is my only ID that shows both my name &amp; photo.  Is it possible to be able to board a flight with the expired drivers license and the printed email showing that it was renewed? Installing from source - do I need to keep the extracted tarball directory If I'm installing from source, do I need to keep the extracted tarball directory?  So if I download the git tarball. I then do:  tar -xvzf git.tar.gz   This will create a git.x.x. directory, into which I cd, then run ./configure etc. Once I'm done with this process, and git, or whatever is installed, do I need to keep the original git.x.x extracted directory, or is that just used for compiling the program?  I'm somewhat confused by all the directories, and folders used for programs. What is the command to add newline linebreak in \sum \prod? I am sure this question or similar has been asked but I cannot find it by searching so adding it to make it more accessible: what is the command/environment to add newline linebreak in \sum \prod so the expression is on two rows instead of one line hard to read?    MWE  \documentclass{article} \usepackage{amsmath,amsfonts}  \begin{document}  $$\sum^{N_{cut}}_{i=1,\newline e_1\in C_i,e_2\not\in C_i} \prod_{j\in C_i} p_j-\sum^{N_{cut}}_{i=1,e_2\in C_i,e_1\not\in C_i} \prod_{j\in C_i} p_j\geq 0$$  \end{document} Prove that for all sets A and B, A ∩ B = ∅ implies ( A ∪ B ) - B = A In the next proof we avail ourselves of the next lemma: For all sets A and B, ( A ∪ B ) - B = A. Proof: Let A and B be arbitrary sets and let x ∈ ( A ∪ B ) - B. x ∈ ( A ∪ B ) - B ⇔ x ∈ ( A ∪ B ) ∧ x ∉ B ⇔ ( x ∈ A ∨ x ∈ B ) ∧ x ∉ B ⇔ ( x ∈ A ∧ x ∉ B ) ∨ ( x ∈ B ∨ x ∉ B) For p ∧ ~ p ≡ F and p ∧ q ⇒ p where p and q are prepositions, ( x ∈ A ∧ x ∉ B ) ∨ ( x ∈ B ∨ x ∉ B ) ⇔ x ∈ A ∨ F By modus tollendo ponens, x ∈ A ∨ F ⇔ x ∈ A So then, x ∈ ( A ∪ B ) - B ⇔ x ∈ A And ( A ∪ B ) - B = A Therefore, the statement for all sets A and B, A ∩ B = ∅  implies ( A ∪ B ) - B = A is true trivially. Is this proof right? One time pad: why is it useless in practice? The symmetric cryptosystem one-time pad (OTP) seems to be very beautiful since it is perfectly secret according to Shannon. Many books, however, point out the main drawback: one must create a secret key the same length as the plaintext. For this reason, the concept of perfect secrecy has these days been abandoned, and we prefer other cryptosystems.   Now, for example, suppose I want to encode my text message with the ASCII scheme, and moreover suppose that this plaintext is 10 gigabytes long, therefore (using an OTP) the key must be the same length, 10 gigabytes. I think, however, this is a ''sustainable price'' because I'm sure that the ciphertext can't be attacked.  Practically, I don't understand why having such long keys with an OTP is a big disadvantage if we reach "the dream"-- namely, perfect secrecy. Nowadays the storage of information is very easy, so what is the real problem? I can, for example, share the "long key" in person. How can I prevent URLDownloadToFile from retrieving from the cache? I am using URLDownloadToFile to retrieve a file from a website. Subsequent calls return the original file rather than an updated version.  I assume it is retrieving a cached version. how can I create a widget out of a php code? It's just a disqus code that I would like to place in the sidebar. I could just paste the code in the widget section (my  tag), but then I would not be able to change it's order with the other wigets. This is why I want to convert this code into a widget. Write-only permission for a directory doesn't allow to rename (move) files inside? In fact, I would like to ask more general question -- &quot;what does write permission for a directory allow you to do exactly?&quot; -- but let's approach it with a concrete example. It is a long question, if you are in a hurry read the bold -- it should cover the main part. Different sources (, , ) say something similar to the following on the directory permissions:  r, read -- reading of the directory's content (filenames inside) w, write -- changing the directory's attributes (e.g. modification time) and creating/renaming/removing entries inside x, search -- accessing files inside, you have access to the inode of the file, hence you can reach it's actual content  My problem is with the description of w. What directory's attributes does it give you access to? I cannot create/rename/remove a file inside a directory with only write permission: I make a directory (tdir/) and a file inside (afile), chmod -x-r tdir/, mv tdir/afile tdir/af, rm tdir/afile, touch tdir/newfile -- all fail with permission denial, unless I set x permission to the directory as well. And x alone doesn't give you the permission to create/rename/remove files inside the directory. In order to do that you need both x and w. But touch tdir does change the modification time of the directory with w only. I would rephrase the sources above this way for the compliance with the issue: a directory's r allows you to see the filenames inside, but no access to the actual file (to the inode); x gives you access to the inodes of the files (which means you can see their permissions and, according to it, have access to the contents), but you still cannot change anything in the directory; directory is actually some sort of a file and to change something in it you need the w permission. Thus, when you are changing something in the directory you need w permission. If your change requires inodes of the files in the directory -- you need x as well. It explains why you cannot remove a file inside a directory with w only: when removing a file you need to reduce the link count of the inode by 1 -- you need to know the inode -- thus you need x for the directory. But why do you need x for creating (you could ask the system to create a file without exposing the inode?) and renaming/moving the file (when you move a file you don't change it in any way, you only change the records inside the directories and their inode counts?)? Maybe it is just an implementation thing? I.e. indeed you don't need the inode for renaming/creating files -- you need only filenames and w permission; but inode and filename constitute one record in the directory; thus changing the filenames = changing the records = kind of accessing the inodes. And also what attributes do directories have besides modification time, permissions and files records? What else in the directory can you change with w only? From A Classical Introduction to Modern Number Theory by Ireland and Rosen, page 33:     Corollary 1 (Euler's Theorem). If $(a,m) = 1$, then $a^{\phi(m)} \equiv 1\,(m)$.      Proof. The units in $\mathbb{Z}/m\mathbb{Z}$ form a group of order $\phi(m)$. If $(a,m) = 1$, $\bar{a}$ is a unit. Thus $\bar{a}^{\phi(m)} = \bar{1}$ or $a^{\phi(m)} \equiv 1\,(m)$.   If I'm interpreting this correctly, this proof implicitly uses the fact(?) that if $G$ is a group and $x\in G$, then $x^{|G|}=1$, where $1$ is the identity element of $G$.  If this is indeed true, can someone explain why? (I have had no prior exposure to group theory.) Why isn't smoke flowing with the shape of the domain? I created this Smoke domain.    Then When I added smoke, it didn't stay within the domain, it went through the hole. Particular nodes are missing from node editor I am looking for the  but it is not available under the Vector nodes menu or any other menu. I have Blender 2.77 which cooresponds with the manual version in the above link.    I also cannot find the Texture Coordinate or Gradient Texture.  Likely I am doing something wrong. If $f \colon [a,b] \rightarrow \mathbb{R}$, then show that there exists $c \in [a,b]$ such that $\int_a^c f = \int_c^b f$ If $f \colon [a,b]\rightarrow \mathbb{R}$, then show that there exists $c \in [a,b]$ such that $c \in [a,b]$ such that $\int_a^c f = \int_c^b f$.  I think that I have to proceed with the Mean Value Theorem of Integrals... math behind complex numbers C||RLC I have a mathematical problem with the following formula. The goal is to transform this equation to have a seperated real and imaginary part. I have already done this with several other equasions, but for this particualar one I don't know where to start.  I dont expect you to do the complete work of transforming for me, it would already be very nice if you could give me a hind on how you would start.  Thank you in advance!  C||RLC      This is my current progress:    My question is:  How can I get rid of the imaginary part jωC2*R?  When the denominator is completely real I can just split up the formula and have an imaginary and a real part. Probability of lim sup, lim inf for sequence of random variables. Maybe this is extremely simple, but i havent found a specific answer for this online.  For a sequence of independent continuous random variables $X_n$ ,$n=1,2,3,...$ , all with the same probability density function $f(x)&gt;0$ for all real $x$, and a specific real number $b$, what do the following events mean in simple terms and what is the probability of each?  a)$\lim_n\sup\{X_n \gt b\}$ b)$\lim_n\inf\{X_n \gt b\}$ c)$\lim_n\sup\{X_n \le b\}$ d)$\lim_n\inf\{X_n \le b\}$ How do I size a UITextView to its content?