graphql-kit / graphql-voyager Goto Github PK
View Code? Open in Web Editor NEW๐ฐ๏ธ Represent any GraphQL API as an interactive graph
Home Page: https://graphql-kit.com/graphql-voyager/
License: MIT License
๐ฐ๏ธ Represent any GraphQL API as an interactive graph
Home Page: https://graphql-kit.com/graphql-voyager/
License: MIT License
Hey, probably a lame question. I've installed raphql-voyager via npm, but I don't see the "Change introspection" button. I see only graph for Query, but can't switch to Mutation view, which is what I thought the button is for. I could probably change it using displayOptions.rootType
, but that would mean exposing two instances of voyager to see both Query and Mutation, right..?
Are there any plans to develop a docker image of the basic html page showcasing voyager? This would be helpful for managing more flexible deployments of the tool without having to worry about the host.
Why can not I import from a CDN or NGINX?
```
<script src="//cdn.jsdelivr.net/react/15.4.2/react.min.js"></script>
<script src="//cdn.jsdelivr.net/react/15.4.2/react-dom.min.js"></script>
<script src="https://apis.guru/graphql-voyager/releases/v1.x/voyager.min.js" ></script>
Error:
Uncaught DOMException: Failed to construct 'Worker': Script at 'https://apis.guru/graphql-voyager/releases/v1.x/voyager.worker.js' cannot be accessed from origin 'http://localhost:3000'.
In cases where you may be behind a single sign on provider, you might need to pass additional options to the fetch
request inside of loadWorker
, such as:
credentials: 'same-origin'
Right now there is no way to do that other than potentially shimming fetch
globally, which doesn't work for the web worker.
Add unit or e2e tests
Feature:
copy to clipboard functionality (for the field list)
While you develop queries on the frontend for a GraphQL endpoint it would be handy to be able to copy field names directly from voyager to your queries..
At the moment this is painful because of the svg rendering.
Proposed solution:
A "copy button" (small clipboard icon in the top right corner of the boxes) which copies all the fields to the clipboard when the user clicks on it.
The copied text would look like this (simple list with line breaks):
name
description
whateverfield
I'm ready to jump into the implementation if the main contributors agree..
When I hit the graphql voyager endpoint, the sidebar loads properly, but the main view gets stuck on "Transmitting..."
In the JS console, I get blob:http://localhost:4000/427b21a8-5a9a-4f6f-8baf-463f5d906201:12 Uncaught SyntaxError: Illegal return statement
Which is buried in the bundle (under // ENSCRIPTEN_END_FUNCS
)
;return{_i64Subtract:t6,_memset:u6,_bitshift64Lshr:z6,_bitshift64Shl:v6,_fflush:m4,_bitshift64Ashr:y6,_vizLastErrorMessage:Gb,_sbrk:H6,_memcpy:B6,_llvm_bswap_i32:K6,___muldi3:G6,___uremdi3:J6,_testSetjmp:A6,_llvm_cttz_i32:C6,_vizCreateFile:Hb,___udivmoddi4:D6,_realloc:n6,_i64Add:w6,_llvm_bswap_i16:L6,_emscripten_get_global_libc:G1,_htons:L4,___udivdi3:E6,___errno_location:L1,___muldsi3:F6,_vizRenderFromString:Ib,_saveSetjmp:x6,_free:l6,_dtextract:Pz,_memmove:I6,_malloc:k6,_memalign:q6,runPostSets:s6,stackAlloc:yb,stackSave:zb,stackRestore:Ab,establishStackSpace:Bb,setTempRet0:Db,getTempRet0:Eb,setThrew:Cb,stackAlloc:yb,stackSave:zb,stackRestore:Ab,establishStackSpace:Bb,setThrew:Cb,setTempRet0:Db,getTempRet0:Eb,dynCall_vi:M6,dynCall_iiii:N6,dynCall_viiiii:O6,dynCall_d:P6,dynCall_di:Q6,dynCall_i:R6,dynCall_iiiiiiiiiii:S6,dynCall_iiidd:T6,dynCall_vii:U6,dynCall_iiiiiii:V6,dynCall_viiiddi:W6,dynCall_viiiiiiiii:X6,dynCall_ii:Y6,dynCall_dddd:Z6,dynCall_viii:_6,dynCall_v:$6,dynCall_iiiii:a7,dynCall_viiiiii:b7,dynCall_iii:c7,dynCall_iiiiii:d7,dynCall_viiii:e7}})
Unsure if this matters, but the generated bundle reads rc-4
instead of 5.
/*!
* GraphQL Voyager - Represent any GraphQL API as an interactive graph
* -------------------------------------------------------------
* Version: "1.0.0-rc.4"
* Repo: https://github.com/APIs-guru/graphql-voyager
*/
When trying to run the demo at https://apis.guru/graphql-voyager/ with a custom schema from https://polar-reef-40902.herokuapp.com/graphiql I get the following error in the console.
Uncaught SyntaxError: Unexpected token u in JSON at position 0
at JSON.parse (<anonymous>)
at n.handleChange (https://apis.guru/graphql-voyager/main.js:24:12961)
at Object.ReactErrorUtils.invokeGuardedCallback (https://cdn.jsdelivr.net/react/15.4.2/react-dom.js:9017:16)
at executeDispatch (https://cdn.jsdelivr.net/react/15.4.2/react-dom.js:3006:21)
at Object.executeDispatchesInOrder (https://cdn.jsdelivr.net/react/15.4.2/react-dom.js:3029:5)
at executeDispatchesAndRelease (https://cdn.jsdelivr.net/react/15.4.2/react-dom.js:2431:22)
at executeDispatchesAndReleaseTopLevel (https://cdn.jsdelivr.net/react/15.4.2/react-dom.js:2442:10)
at Array.forEach (native)
at forEachAccumulated (https://cdn.jsdelivr.net/react/15.4.2/react-dom.js:15423:9)
at Object.processEventQueue (https://cdn.jsdelivr.net/react/15.4.2/react-dom.js:2645:7)
The UI tells me that the JSON is valid when pasting the result into Custom Introspection
field.
Any ideas to get me going? Maybe a bug?
It would be nice not to have to make the query and paste the result, even if it requires adding a CORS exception to my server (or deploying my own copy).
(This is partially the result of the size of the introspected schema JSON object, ~6.3 Mb compared to the built-ins which are 800k at most.)
I'd love to be able to hide individual schemas (plus their connections) from the view.
The biggest use case is hiding the root query from the view.
Right now we have 20 queryable entities, which means there's 20 (redundant) links on the UI from just that.
I'd like to hide it so that we can make it easier to understand.
Thank you for building such useful tooling for the GraphQL community! One enhancement for users of TypeScript:
The build:middleware
NPM script should pass tsc --declaration
so .d.ts
files will be generated for library consumers.
See also: the Publishing section of the TypeScript handbook
displayOptions not work in graphql-voyager/middleware.
router.all('/voyager', voyagerMiddleware({
endpointUrl: '/graphql',
displayOptions: {
sortByAlphabet: true
}
}));
When running a custom introspection query from live demo, the UI does not allow me to proceed as the button is showing the error
TypeError: Cannot read property 'type' of undefined
The introspection query (copied from the demo page) and the result can be found at:
graphql-voyager 1.0.0-rc.9
I am trying to use this amazing component in a basic create-react-app but it is stuck on 'transmitting', the schema in the left sider loads fine though.
The chrome console logs a 'Uncaught SyntaxError: Unexpected token <'.
Here is a repo that reproduces the issue: https://github.com/LarsKrogJensen/voyager-issue44
The docs state a paragraph that I don't understand:
Important: make sure to copy voyager.worker.js from node_modules/graphql-voyager/dist to the same folder as your main bundle.
Where in the demo-repo am I supposed to copy the file.
you are already using graphql
in version 0.10.5
as dev dep
, but the peer dep
is still 0.9.x
, can you update the peer dep
to also work with 0.10.x
and 0.11.x
, please?
Following the readme I'd assume I can set displayOptions when rendering Voyager in the body.
Based on the index.html from the sample I have the following code:
// Render <Voyager /> into the body.
GraphQLVoyager.init(document.getElementById('voyager'), {
introspection: introspectionProvider,
displayOptions: { skipRelay: false, rootType: 'HealthQuery', sortByAlphabet: true }
});
The rendering works fine, but the skipRelay: false option is not considered (rootType and sortByAlphabet are not considered also).
Is something wrong with the init given above or is this a bug?
Hi โค๏ธโค๏ธโค๏ธ !!! This gem is awesome and will be a game changer, I've used the live demo with custom schemas a few times already.
We run a microservices architecture and we are slowly moving the APIs from REST to GraphQL and I am considering having an internal version of Voyager running so anyone in our organization can introspect and learn about the APIs we have available.
It seems like the presets like Star Wars, Yelp, Shopify, and Github are hard-coded here https://github.com/APIs-guru/graphql-voyager/blob/master/src/presets.ts and the result of the introspection query are stored here https://github.com/APIs-guru/graphql-voyager/tree/master/src/introspection/presets. For demo purposes this makes total sense.
My feature request is: it would be nice to be able to list a series of endpoints and their names and have them listed in Voyager in the landing page, Voyager would then perform the introspection query and show the latest schema.
I would imagine something like the following:
window.VOYAGER_PRESETS = {
'clients': {url: 'https://clients.foo.com/api/graphql'},
'accounts': {url: 'https://accounts.foo.com/v3/graph'},
'orders': {url: 'https://orders-srv.foo.com/api/graphql'},
};
Related issues:
With any moderately complex graph using interfaces, duplication of the fields on all implementations of the interface causes the visualisation to become overly complicated and full of (arguably) redundant relationships.
For example, take the following screenshot:
In this case SlatePlayer
defines > 6 relations on fields, and (currently) has 3 implementations of the interface. This results in 18 additional lines on the graph, which really I can infer from the fact that the MlbSlatePlayer
is an implementation of the SlatePlayer
interface.
I would propose a display option to hide fields that are common to their interface to optionally reduce noise.
Refactor out all the ๐ฉ after MVP release
Hi there,
I love the tool! Very nice way of visualizing a schema. I am quite new to GraphQL and run into an issue:
Whenever I try to create some sort of introspection query and copy it into the "custom schema" field, I am presented with different errors like "TypeError: Cannot read property 'map' of undefined", "TypeError: Cannot read property 'types' of undefined" or similar. Even the official examples on http://graphql.org/learn/introspection/ cause errors.
The only "valid" result I could get working was with the query https://gist.github.com/craigbeck/b90915d49fda19d5b2b17ead14dcd6da on the github API https://developer.github.com/v4/explorer/
So in other words:
How does my introspection query have to look like or comply with to work with graphql-voyager?
Thanks up front!
Publish as a package which users can deploy to their site
I tried copying and pasting output from graphql get-schema but no joy.
should be easier to import.
This tool is awesome! Are you planning to parse input types as well?
Using the graphql-cli-voyager plugin I noticed that it only shows query
graphs and is missing mutation
graphs.
Thanks for creating this, it looks great!
One feature I'd appreciate is the ability to (a) drag types around, and persist the coords and (b) hide some of the types.
My use case is that I want to use this app as a way to explore my quite complex GraphQL schema. Because it's complex, it benefits from having a human lay things out nicely.
I imagine you could store a map like the following:
{
"PersonType": {
x: 200,
y: 302,
hidden: false,
}
}
which overrides automatic layout. Then when the schema is updated, as long as the name of the type doesn't change, things should be roughly ok (maybe).
Maybe it could be possible to hide some edges too.
Do you have any such plans?
Hello everybody,
What are you thinking about the idea to add middleware for frameworks like express, koa etc in the same way as apollographql does for graphiql ?
I can take care about this.
This will open lots of potential use cases
Invariant Violation: addComponentAsRefTo(...): Only a ReactOwner can have refs. You might be adding a ref to a component that was not created inside a component's `render` method, or you have multiple copies of React loaded (details: https://fb.me/react-refs-must-have-owner).
The worker.min.js file is being rejected by my site's Content Security Policy for use of eval
.
The only workaround is to add 'unsafe-eval' to the 'script-src' directive, which is not good practice at all.
In my schema I have groups: [CustomerGroup!]
, but Voyager display it as "groups: [CustomerGroup ]!".
The opposite case, when I set in the schema groups: [CustomerGroup]!
, the Voyager shows it as "groups: [CustomerGroup !]"
"apollo-server-express": "^1.3.0",
"babel-cli": "^6.26.0",
"babel-core": "^6.26.0",
"babel-plugin-module-resolver": "^3.0.0",
"babel-preset-es2015": "^6.24.1",
"babel-preset-stage-2": "^6.24.1",
"express": "^4.16.2",
"graphql": "^0.11.7",
"graphql-tools": "^2.13.0",
"graphql-voyager": "^1.0.0-rc.10",
app.use("/voyager", middleware({ endpointUrl: "/graphql" }));
When I integrate it with the download link https://apis.guru/graphql-voyager/releases/v1.0.0-rc.7/voyager.min.js and the worker.js. at https://apis.guru/graphql-voyager/releases/v1.0.0-rc.7/voyager.worker.js and Then I got only this...
No graph,
And there is no dist folder in the released zip.
suggested by Nikolai Aleksandrenko
import { koa as middleware } from 'graphql-voyager/middleware'; router.all('/voyager', voyagerMiddleware({ endpointUrl: '/graphql' }));
voyagerMiddleware does not match up with what is voyager is imported as. voyagerMiddleware should be simply middleware.
Refactor css using rscss structure
It would be great to be able to link to a schema or even to a schema element, for example /[schema]/[root element]/[focus element]?schema_url=data:...
Uncaught SyntaxError: Unexpected token < voyager.worker.js:1
<!DOCTYPE html>
<html>
<head>
....
Would be good for large GraphQL responses to be able to do a Custom Introspection from a Github Gist URL as well as pasting into a field.
Hi this Tool looks awesome!
Do you see a chance to make it editable so that the type definitions are updated from within the voyager ?
{
"swagger": "2.0",
"schemes": [
"http"
],
"host": "sts.amazonaws.com",
"basePath": "/",
"x-hasEquivalentPaths": true,
"info": {
"contact": {
"email": "[email protected]",
"name": "Mike Ralphson",
"url": "https://github.com/mermade/aws2openapi"
},
"description": "AWS Security Token Service
The AWS Security Token Service (STS) is a web service that enables you to request temporary, limited-privilege credentials for AWS Identity and Access Management (IAM) users or for users that you authenticate (federated users). This guide provides descriptions of the STS API. For more detailed information about using this service, go to <a href="http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp.html\">Temporary Security Credentials.
As an alternative to using the API, you can use one of the AWS SDKs, which consist of libraries and sample code for various programming languages and platforms (Java, Ruby, .NET, iOS, Android, etc.). The SDKs provide a convenient way to create programmatic access to STS. For example, the SDKs take care of cryptographically signing requests, managing errors, and retrying requests automatically. For information about the AWS SDKs, including how to download and install them, see the <a href="http://aws.amazon.com/tools/\">Tools for Amazon Web Services page.
For information about setting up signatures and authorization through the API, go to <a href="http://docs.aws.amazon.com/general/latest/gr/signing_aws_api_requests.html\">Signing AWS API Requests in the AWS General Reference. For general information about the Query API, go to <a href="http://docs.aws.amazon.com/IAM/latest/UserGuide/IAM_UsingQueryAPI.html\">Making Query Requests in Using IAM. For information about using security tokens with other AWS products, go to <a href="http://docs.aws.amazon.com/IAM/latest/UserGuide/reference_aws-services-that-work-with-iam.html\">AWS Services That Work with IAM in the IAM User Guide.
If you're new to AWS and need additional technical information about a specific AWS product, you can find the product's technical documentation at <a href="http://aws.amazon.com/documentation/\">http://aws.amazon.com/documentation/.
Endpoints
The AWS Security Token Service (STS) has a default endpoint of https://sts.amazonaws.com that maps to the US East (N. Virginia) region. Additional regions are available and are activated by default. For more information, see <a href="http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html\">Activating and Deactivating AWS STS in an AWS Region in the IAM User Guide.
For information about STS endpoints, see <a href="http://docs.aws.amazon.com/general/latest/gr/rande.html#sts_region\">Regions and Endpoints in the AWS General Reference.
Recording API requests
STS supports AWS CloudTrail, which is a service that records AWS calls for your AWS account and delivers log files to an Amazon S3 bucket. By using information collected by CloudTrail, you can determine what requests were successfully made to STS, who made the request, when it was made, and so on. To learn more about CloudTrail, including how to turn it on and find your log files, see the <a href="http://docs.aws.amazon.com/awscloudtrail/latest/userguide/what_is_cloud_trail_top_level.html\">AWS CloudTrail User Guide.
",Returns a set of temporary security credentials (consisting of an access key ID, a secret access key, and a security token) that you can use to access AWS resources that you might not normally have access to. Typically, you use AssumeRole
for cross-account access or federation. For a comparison of AssumeRole
with the other APIs that produce temporary credentials, see <a href="http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html\">Requesting Temporary Security Credentials and <a href="http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#stsapi_comparison\">Comparing the AWS STS APIs in the IAM User Guide.
Important: You cannot call AssumeRole
by using AWS root account credentials; access is denied. You must use credentials for an IAM user or an IAM role to call AssumeRole
.
For cross-account access, imagine that you own multiple accounts and need to access resources in each account. You could create long-term credentials in each account to access those resources. However, managing all those credentials and remembering which one can access which account can be time consuming. Instead, you can create one set of long-term credentials in one account and then use temporary security credentials to access all the other accounts by assuming roles in those accounts. For more information about roles, see <a href="http://docs.aws.amazon.com/IAM/latest/UserGuide/roles-toplevel.html\">IAM Roles (Delegation and Federation) in the IAM User Guide.
For federation, you can, for example, grant single sign-on access to the AWS Management Console. If you already have an identity and authentication system in your corporate network, you don't have to recreate user identities in AWS in order to grant those user identities access to AWS. Instead, after a user has been authenticated, you call AssumeRole
(and specify the role with the appropriate permissions) to get temporary security credentials for that user. With those temporary security credentials, you construct a sign-in URL that users can use to access the console. For more information, see <a href="http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp.html#sts-introduction\">Common Scenarios for Temporary Credentials in the IAM User Guide.
The temporary security credentials are valid for the duration that you specified when calling AssumeRole
, which can be from 900 seconds (15 minutes) to a maximum of 3600 seconds (1 hour). The default is 1 hour.
The temporary security credentials created by AssumeRole
can be used to make API calls to any AWS service with the following exception: you cannot call the STS service's GetFederationToken
or GetSessionToken
APIs.
Optionally, you can pass an IAM access policy to this operation. If you choose not to pass a policy, the temporary security credentials that are returned by the operation have the permissions that are defined in the access policy of the role that is being assumed. If you pass a policy to this operation, the temporary security credentials that are returned by the operation have the permissions that are allowed by both the access policy of the role that is being assumed, and the policy that you pass. This gives you a way to further restrict the permissions for the resulting temporary security credentials. You cannot use the passed policy to grant permissions that are in excess of those allowed by the access policy of the role that is being assumed. For more information, see <a href="http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_assumerole.html\">Permissions for AssumeRole, AssumeRoleWithSAML, and AssumeRoleWithWebIdentity in the IAM User Guide.
To assume a role, your AWS account must be trusted by the role. The trust relationship is defined in the role's trust policy when the role is created. That trust policy states which accounts are allowed to delegate access to this account's role.
The user who wants to access the role must also have permissions delegated from the role's administrator. If the user is in a different account than the role, then the user's administrator must attach a policy that allows the user to call AssumeRole on the ARN of the role in the other account. If the user is in the same account as the role, then you can either attach a policy to the user (identical to the previous different account user), or you can add the user as a principal directly in the role's trust policy
Using MFA with AssumeRole
You can optionally include multi-factor authentication (MFA) information when you call AssumeRole
. This is useful for cross-account scenarios in which you want to make sure that the user who is assuming the role has been authenticated using an AWS MFA device. In that scenario, the trust policy of the role being assumed includes a condition that tests for MFA authentication; if the caller does not include valid MFA information, the request to assume the role is denied. The condition in a trust policy that tests for MFA authentication might look like the following example.
"Condition": {"Bool": {"aws:MultiFactorAuthPresent": true}}
For more information, see <a href="http://docs.aws.amazon.com/IAM/latest/UserGuide/MFAProtectedAPI.html\">Configuring MFA-Protected API Access in the IAM User Guide guide.
To use MFA with AssumeRole
, you pass values for the SerialNumber
and TokenCode
parameters. The SerialNumber
value identifies the user's hardware or virtual MFA device. The TokenCode
is the time-based one-time password (TOTP) that the MFA devices produces.
Returns a set of temporary security credentials for users who have been authenticated via a SAML authentication response. This operation provides a mechanism for tying an enterprise identity store or directory to role-based AWS access without user-specific credentials or configuration. For a comparison of AssumeRoleWithSAML
with the other APIs that produce temporary credentials, see <a href="http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html\">Requesting Temporary Security Credentials and <a href="http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#stsapi_comparison\">Comparing the AWS STS APIs in the IAM User Guide.
The temporary security credentials returned by this operation consist of an access key ID, a secret access key, and a security token. Applications can use these temporary security credentials to sign calls to AWS services.
The temporary security credentials are valid for the duration that you specified when calling AssumeRole
, or until the time specified in the SAML authentication response's SessionNotOnOrAfter
value, whichever is shorter. The duration can be from 900 seconds (15 minutes) to a maximum of 3600 seconds (1 hour). The default is 1 hour.
The temporary security credentials created by AssumeRoleWithSAML
can be used to make API calls to any AWS service with the following exception: you cannot call the STS service's GetFederationToken
or GetSessionToken
APIs.
Optionally, you can pass an IAM access policy to this operation. If you choose not to pass a policy, the temporary security credentials that are returned by the operation have the permissions that are defined in the access policy of the role that is being assumed. If you pass a policy to this operation, the temporary security credentials that are returned by the operation have the permissions that are allowed by the intersection of both the access policy of the role that is being assumed, and the policy that you pass. This means that both policies must grant the permission for the action to be allowed. This gives you a way to further restrict the permissions for the resulting temporary security credentials. You cannot use the passed policy to grant permissions that are in excess of those allowed by the access policy of the role that is being assumed. For more information, see <a href="http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_assumerole.html\">Permissions for AssumeRole, AssumeRoleWithSAML, and AssumeRoleWithWebIdentity in the IAM User Guide.
Before your application can call AssumeRoleWithSAML
, you must configure your SAML identity provider (IdP) to issue the claims required by AWS. Additionally, you must use AWS Identity and Access Management (IAM) to create a SAML provider entity in your AWS account that represents your identity provider, and create an IAM role that specifies this SAML provider in its trust policy.
Calling AssumeRoleWithSAML
does not require the use of AWS security credentials. The identity of the caller is validated by using keys in the metadata document that is uploaded for the SAML provider entity for your identity provider.
Calling AssumeRoleWithSAML
can result in an entry in your AWS CloudTrail logs. The entry includes the value in the NameID
element of the SAML assertion. We recommend that you use a NameIDType that is not associated with any personally identifiable information (PII). For example, you could instead use the Persistent Identifier (urn:oasis:names:tc:SAML:2.0:nameid-format:persistent
).
For more information, see the following resources:
<a href="http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_saml.html\">About SAML 2.0-based Federation in the IAM User Guide.
<a href="http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_create_saml.html\">Creating SAML Identity Providers in the IAM User Guide.
<a href="http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_create_saml_relying-party.html\">Configuring a Relying Party and Claims in the IAM User Guide.
<a href="http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-idp_saml.html\">Creating a Role for SAML 2.0 Federation in the IAM User Guide.
Returns a set of temporary security credentials for users who have been authenticated in a mobile or web application with a web identity provider, such as Amazon Cognito, Login with Amazon, Facebook, Google, or any OpenID Connect-compatible identity provider.
For mobile applications, we recommend that you use Amazon Cognito. You can use Amazon Cognito with the <a href="http://aws.amazon.com/sdkforios/\">AWS SDK for iOS and the <a href="http://aws.amazon.com/sdkforandroid/\">AWS SDK for Android to uniquely identify a user and supply the user with a consistent identity throughout the lifetime of an application.
To learn more about Amazon Cognito, see <a href="http://docs.aws.amazon.com/mobile/sdkforandroid/developerguide/cognito-auth.html#d0e840\">Amazon Cognito Overview in the AWS SDK for Android Developer Guide guide and <a href="http://docs.aws.amazon.com/mobile/sdkforios/developerguide/cognito-auth.html#d0e664\">Amazon Cognito Overview in the AWS SDK for iOS Developer Guide.
Calling AssumeRoleWithWebIdentity
does not require the use of AWS security credentials. Therefore, you can distribute an application (for example, on mobile devices) that requests temporary security credentials without including long-term AWS credentials in the application, and without deploying server-based proxy services that use long-term AWS credentials. Instead, the identity of the caller is validated by using a token from the web identity provider. For a comparison of AssumeRoleWithWebIdentity
with the other APIs that produce temporary credentials, see <a href="http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html\">Requesting Temporary Security Credentials and <a href="http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#stsapi_comparison\">Comparing the AWS STS APIs in the IAM User Guide.
The temporary security credentials returned by this API consist of an access key ID, a secret access key, and a security token. Applications can use these temporary security credentials to sign calls to AWS service APIs.
The credentials are valid for the duration that you specified when calling AssumeRoleWithWebIdentity
, which can be from 900 seconds (15 minutes) to a maximum of 3600 seconds (1 hour). The default is 1 hour.
The temporary security credentials created by AssumeRoleWithWebIdentity
can be used to make API calls to any AWS service with the following exception: you cannot call the STS service's GetFederationToken
or GetSessionToken
APIs.
Optionally, you can pass an IAM access policy to this operation. If you choose not to pass a policy, the temporary security credentials that are returned by the operation have the permissions that are defined in the access policy of the role that is being assumed. If you pass a policy to this operation, the temporary security credentials that are returned by the operation have the permissions that are allowed by both the access policy of the role that is being assumed, and the policy that you pass. This gives you a way to further restrict the permissions for the resulting temporary security credentials. You cannot use the passed policy to grant permissions that are in excess of those allowed by the access policy of the role that is being assumed. For more information, see <a href="http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_assumerole.html\">Permissions for AssumeRole, AssumeRoleWithSAML, and AssumeRoleWithWebIdentity in the IAM User Guide.
Before your application can call AssumeRoleWithWebIdentity
, you must have an identity token from a supported identity provider and create a role that the application can assume. The role that your application assumes must trust the identity provider that is associated with the identity token. In other words, the identity provider must be specified in the role's trust policy.
Calling AssumeRoleWithWebIdentity
can result in an entry in your AWS CloudTrail logs. The entry includes the <a href="http://openid.net/specs/openid-connect-core-1_0.html#Claims\">Subject of the provided Web Identity Token. We recommend that you avoid using any personally identifiable information (PII) in this field. For example, you could instead use a GUID or a pairwise identifier, as <a href="http://openid.net/specs/openid-connect-core-1_0.html#SubjectIDTypes\">suggested in the OIDC specification.
For more information about how to use web identity federation and the AssumeRoleWithWebIdentity
API, see the following resources:
<a href="http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_oidc_manual.html\">Using Web Identity Federation APIs for Mobile Apps and <a href="http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#api_assumerolewithwebidentity\">Federation Through a Web-based Identity Provider.
<a href="https://web-identity-federation-playground.s3.amazonaws.com/index.html\"> Web Identity Federation Playground. This interactive website lets you walk through the process of authenticating via Login with Amazon, Facebook, or Google, getting temporary security credentials, and then using those credentials to make a request to AWS.
<a href="http://aws.amazon.com/sdkforios/\">AWS SDK for iOS and <a href="http://aws.amazon.com/sdkforandroid/\">AWS SDK for Android. These toolkits contain sample apps that show how to invoke the identity providers, and then how to use the information from these providers to get and use temporary security credentials.
<a href="http://aws.amazon.com/articles/4617974389850313\">Web Identity Federation with Mobile Applications. This article discusses web identity federation and shows an example of how to use web identity federation to get access to content in Amazon S3.
Decodes additional information about the authorization status of a request from an encoded message returned in response to an AWS request.
For example, if a user is not authorized to perform an action that he or she has requested, the request returns a Client.UnauthorizedOperation
response (an HTTP 403 response). Some AWS actions additionally return an encoded message that can provide details about this authorization failure.
Only certain AWS actions return an encoded authorization message. The documentation for an individual action indicates whether that action returns an encoded message in addition to returning an HTTP code.
The message is encoded because the details of the authorization status can constitute privileged information that the user who requested the action should not see. To decode an authorization status message, a user must be granted permissions via an IAM policy to request the DecodeAuthorizationMessage
(sts:DecodeAuthorizationMessage
) action.
The decoded message includes the following type of information:
Whether the request was denied due to an explicit deny or due to the absence of an explicit allow. For more information, see <a href="http://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_evaluation-logic.html#policy-eval-denyallow\">Determining Whether a Request is Allowed or Denied in the IAM User Guide.
The principal who made the request.
The requested action.
The requested resource.
The values of condition keys in the context of the user's request.
Returns a set of temporary security credentials (consisting of an access key ID, a secret access key, and a security token) for a federated user. A typical use is in a proxy application that gets temporary security credentials on behalf of distributed applications inside a corporate network. Because you must call the GetFederationToken
action using the long-term security credentials of an IAM user, this call is appropriate in contexts where those credentials can be safely stored, usually in a server-based application. For a comparison of GetFederationToken
with the other APIs that produce temporary credentials, see <a href="http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html\">Requesting Temporary Security Credentials and <a href="http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#stsapi_comparison\">Comparing the AWS STS APIs in the IAM User Guide.
If you are creating a mobile-based or browser-based app that can authenticate users using a web identity provider like Login with Amazon, Facebook, Google, or an OpenID Connect-compatible identity provider, we recommend that you use <a href="http://aws.amazon.com/cognito/\">Amazon Cognito or AssumeRoleWithWebIdentity
. For more information, see <a href="http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#api_assumerolewithwebidentity\">Federation Through a Web-based Identity Provider.
The GetFederationToken
action must be called by using the long-term AWS security credentials of an IAM user. You can also call GetFederationToken
using the security credentials of an AWS root account, but we do not recommended it. Instead, we recommend that you create an IAM user for the purpose of the proxy application and then attach a policy to the IAM user that limits federated users to only the actions and resources that they need access to. For more information, see <a href="http://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html\">IAM Best Practices in the IAM User Guide.
The temporary security credentials that are obtained by using the long-term credentials of an IAM user are valid for the specified duration, from 900 seconds (15 minutes) up to a maximium of 129600 seconds (36 hours). The default is 43200 seconds (12 hours). Temporary credentials that are obtained by using AWS root account credentials have a maximum duration of 3600 seconds (1 hour).
The temporary security credentials created by GetFederationToken
can be used to make API calls to any AWS service with the following exceptions:
You cannot use these credentials to call any IAM APIs.
You cannot call any STS APIs except GetCallerIdentity
.
Permissions
The permissions for the temporary security credentials returned by GetFederationToken
are determined by a combination of the following:
The policy or policies that are attached to the IAM user whose credentials are used to call GetFederationToken
.
The policy that is passed as a parameter in the call.
The passed policy is attached to the temporary security credentials that result from the GetFederationToken
API call--that is, to the federated user. When the federated user makes an AWS request, AWS evaluates the policy attached to the federated user in combination with the policy or policies attached to the IAM user whose credentials were used to call GetFederationToken
. AWS allows the federated user's request only when both the federated user and the IAM user are explicitly allowed to perform the requested action. The passed policy cannot grant more permissions than those that are defined in the IAM user policy.
A typical use case is that the permissions of the IAM user whose credentials are used to call GetFederationToken
are designed to allow access to all the actions and resources that any federated user will need. Then, for individual users, you pass a policy to the operation that scopes down the permissions to a level that's appropriate to that individual user, using a policy that allows only a subset of permissions that are granted to the IAM user.
If you do not pass a policy, the resulting temporary security credentials have no effective permissions. The only exception is when the temporary security credentials are used to access a resource that has a resource-based policy that specifically allows the federated user to access the resource.
For more information about how permissions work, see <a href="http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_getfederationtoken.html\">Permissions for GetFederationToken. For information about using GetFederationToken
to create temporary security credentials, see <a href="http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#api_getfederationtoken\">GetFederationTokenโFederation Through a Custom Identity Broker.
Returns a set of temporary credentials for an AWS account or IAM user. The credentials consist of an access key ID, a secret access key, and a security token. Typically, you use GetSessionToken
if you want to use MFA to protect programmatic calls to specific AWS APIs like Amazon EC2 StopInstances
. MFA-enabled IAM users would need to call GetSessionToken
and submit an MFA code that is associated with their MFA device. Using the temporary security credentials that are returned from the call, IAM users can then make programmatic calls to APIs that require MFA authentication. If you do not supply a correct MFA code, then the API returns an access denied error. For a comparison of GetSessionToken
with the other APIs that produce temporary credentials, see <a href="http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html\">Requesting Temporary Security Credentials and <a href="http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#stsapi_comparison\">Comparing the AWS STS APIs in the IAM User Guide.
The GetSessionToken
action must be called by using the long-term AWS security credentials of the AWS account or an IAM user. Credentials that are created by IAM users are valid for the duration that you specify, from 900 seconds (15 minutes) up to a maximum of 129600 seconds (36 hours), with a default of 43200 seconds (12 hours); credentials that are created by using account credentials can range from 900 seconds (15 minutes) up to a maximum of 3600 seconds (1 hour), with a default of 1 hour.
The temporary security credentials created by GetSessionToken
can be used to make API calls to any AWS service with the following exceptions:
You cannot call any IAM APIs unless MFA authentication information is included in the request.
You cannot call any STS API except AssumeRole
or GetCallerIdentity
.
We recommend that you do not call GetSessionToken
with root account credentials. Instead, follow our <a href="http://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html#create-iam-users\">best practices by creating one or more IAM users, giving them the necessary permissions, and using IAM users for everyday interaction with AWS.
The permissions associated with the temporary security credentials returned by GetSessionToken
are based on the permissions associated with account or IAM user whose credentials are used to call the action. If GetSessionToken
is called using root account credentials, the temporary credentials have root account permissions. Similarly, if GetSessionToken
is called using the credentials of an IAM user, the temporary credentials have the same permissions as the IAM user.
For more information about using GetSessionToken
to create temporary credentials, go to <a href="http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#api_getsessiontoken\">Temporary Credentials for Users in Untrusted Environments in the IAM User Guide.
The duration, in seconds, of the role session. The value can range from 900 seconds (15 minutes) to 3600 seconds (1 hour). By default, the value is set to 3600 seconds.
This is separate from the duration of a console session that you might request using the returned credentials. The request to the federation endpoint for a console sign-in token takes a SessionDuration
parameter that specifies the maximum length of the console session, separately from the DurationSeconds
parameter on this API. For more information, see <a href="http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_enable-console-custom-url.html\">Creating a URL that Enables Federated Users to Access the AWS Management Console in the IAM User Guide.
A unique identifier that is used by third parties when assuming roles in their customers' accounts. For each role that the third party can assume, they should instruct their customers to ensure the role's trust policy checks for the external ID that the third party generated. Each time the third party assumes the role, they should pass the customer's external ID. The external ID is useful in order to help third parties bind a role to the customer who created it. For more information about the external ID, see <a href="http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-user_externalid.html\">How to Use an External ID When Granting Access to Your AWS Resources to a Third Party in the IAM User Guide.
The regex used to validated this parameter is a string of characters consisting of upper- and lower-case alphanumeric characters with no spaces. You can also include underscores or any of the following characters: =,.@:/-
"An IAM policy in JSON format.
This parameter is optional. If you pass a policy, the temporary security credentials that are returned by the operation have the permissions that are allowed by both (the intersection of) the access policy of the role that is being assumed, and the policy that you pass. This gives you a way to further restrict the permissions for the resulting temporary security credentials. You cannot use the passed policy to grant permissions that are in excess of those allowed by the access policy of the role that is being assumed. For more information, see <a href="http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_assumerole.html\">Permissions for AssumeRole, AssumeRoleWithSAML, and AssumeRoleWithWebIdentity in the IAM User Guide.
The format for this parameter, as described by its regex pattern, is a string of characters up to 2048 characters in length. The characters can be any ASCII character from the space character to the end of the valid character list (\u0020-\u00FF). It can also include the tab (\u0009), linefeed (\u000A), and carriage return (\u000D) characters.
The policy plain text must be 2048 bytes or shorter. However, an internal conversion compresses it into a packed binary format with a separate limit. The PackedPolicySize response element indicates by percentage how close to the upper size limit the policy is, with 100% equaling the maximum allowed size.
"An identifier for the assumed role session.
Use the role session name to uniquely identify a session when the same role is assumed by different principals or for different reasons. In cross-account scenarios, the role session name is visible to, and can be logged by the account that owns the role. The role session name is also used in the ARN of the assumed role principal. This means that subsequent cross-account API requests using the temporary security credentials will expose the role session name to the external account in their CloudTrail logs.
The regex used to validate this parameter is a string of characters consisting of upper- and lower-case alphanumeric characters with no spaces. You can also include underscores or any of the following characters: =,.@-
"The identification number of the MFA device that is associated with the user who is making the AssumeRole
call. Specify this value if the trust policy of the role being assumed includes a condition that requires MFA authentication. The value is either the serial number for a hardware device (such as GAHT12345678
) or an Amazon Resource Name (ARN) for a virtual device (such as arn:aws:iam::123456789012:mfa/user
).
The regex used to validate this parameter is a string of characters consisting of upper- and lower-case alphanumeric characters with no spaces. You can also include underscores or any of the following characters: =,.@-
"The value provided by the MFA device, if the trust policy of the role being assumed requires MFA (that is, if the policy includes a condition that tests for MFA). If the role being assumed requires MFA and if the TokenCode
value is missing or expired, the AssumeRole
call returns an "access denied" error.
The format for this parameter, as described by its regex pattern, is a sequence of six numeric digits.
"RoleSessionName
that you specified when you called AssumeRole
. "The temporary security credentials, which include an access key ID, a secret access key, and a security (or session) token.
Note: The size of the security token that STS APIs return is not fixed. We strongly recommend that you make no assumptions about the maximum size. As of this writing, the typical size is less than 4096 bytes, but that can vary. Also, future updates to AWS might require larger sizes.
"The duration, in seconds, of the role session. The value can range from 900 seconds (15 minutes) to 3600 seconds (1 hour). By default, the value is set to 3600 seconds. An expiration can also be specified in the SAML authentication response's SessionNotOnOrAfter
value. The actual expiration time is whichever value is shorter.
This is separate from the duration of a console session that you might request using the returned credentials. The request to the federation endpoint for a console sign-in token takes a SessionDuration
parameter that specifies the maximum length of the console session, separately from the DurationSeconds
parameter on this API. For more information, see <a href="http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_enable-console-saml.html\">Enabling SAML 2.0 Federated Users to Access the AWS Management Console in the IAM User Guide.
An IAM policy in JSON format.
The policy parameter is optional. If you pass a policy, the temporary security credentials that are returned by the operation have the permissions that are allowed by both the access policy of the role that is being assumed, and the policy that you pass. This gives you a way to further restrict the permissions for the resulting temporary security credentials. You cannot use the passed policy to grant permissions that are in excess of those allowed by the access policy of the role that is being assumed. For more information, <a href="http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_assumerole.html\">Permissions for AssumeRole, AssumeRoleWithSAML, and AssumeRoleWithWebIdentity in the IAM User Guide.
The format for this parameter, as described by its regex pattern, is a string of characters up to 2048 characters in length. The characters can be any ASCII character from the space character to the end of the valid character list (\u0020-\u00FF). It can also include the tab (\u0009), linefeed (\u000A), and carriage return (\u000D) characters.
The policy plain text must be 2048 bytes or shorter. However, an internal conversion compresses it into a packed binary format with a separate limit. The PackedPolicySize response element indicates by percentage how close to the upper size limit the policy is, with 100% equaling the maximum allowed size.
"The base-64 encoded SAML authentication response provided by the IdP.
For more information, see <a href="http://docs.aws.amazon.com/IAM/latest/UserGuide/create-role-saml-IdP-tasks.html\">Configuring a Relying Party and Adding Claims in the Using IAM guide.
"Recipient
attribute of the SubjectConfirmationData
element of the SAML assertion. "The temporary security credentials, which include an access key ID, a secret access key, and a security (or session) token.
Note: The size of the security token that STS APIs return is not fixed. We strongly recommend that you make no assumptions about the maximum size. As of this writing, the typical size is less than 4096 bytes, but that can vary. Also, future updates to AWS might require larger sizes.
"Issuer
element of the SAML assertion."A hash value based on the concatenation of the Issuer
response value, the AWS account ID, and the friendly name (the last part of the ARN) of the SAML provider in IAM. The combination of NameQualifier
and Subject
can be used to uniquely identify a federated user.
The following pseudocode shows how the hash value is calculated:
BASE64 ( SHA1 ( "https://example.com/saml\" + "123456789012" + "/MySAMLIdP" ) )
NameID
element in the Subject
element of the SAML assertion." The format of the name ID, as defined by the Format
attribute in the NameID
element of the SAML assertion. Typical examples of the format are transient
or persistent
.
If the format includes the prefix urn:oasis:names:tc:SAML:2.0:nameid-format
, that prefix is removed. For example, urn:oasis:names:tc:SAML:2.0:nameid-format:transient
is returned as transient
. If the format includes any other prefix, the format is returned with no modifications.
The duration, in seconds, of the role session. The value can range from 900 seconds (15 minutes) to 3600 seconds (1 hour). By default, the value is set to 3600 seconds.
This is separate from the duration of a console session that you might request using the returned credentials. The request to the federation endpoint for a console sign-in token takes a SessionDuration
parameter that specifies the maximum length of the console session, separately from the DurationSeconds
parameter on this API. For more information, see <a href="http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_enable-console-custom-url.html\">Creating a URL that Enables Federated Users to Access the AWS Management Console in the IAM User Guide.
An IAM policy in JSON format.
The policy parameter is optional. If you pass a policy, the temporary security credentials that are returned by the operation have the permissions that are allowed by both the access policy of the role that is being assumed, and the policy that you pass. This gives you a way to further restrict the permissions for the resulting temporary security credentials. You cannot use the passed policy to grant permissions that are in excess of those allowed by the access policy of the role that is being assumed. For more information, see <a href="http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_assumerole.html\">Permissions for AssumeRoleWithWebIdentity in the IAM User Guide.
The format for this parameter, as described by its regex pattern, is a string of characters up to 2048 characters in length. The characters can be any ASCII character from the space character to the end of the valid character list (\u0020-\u00FF). It can also include the tab (\u0009), linefeed (\u000A), and carriage return (\u000D) characters.
The policy plain text must be 2048 bytes or shorter. However, an internal conversion compresses it into a packed binary format with a separate limit. The PackedPolicySize response element indicates by percentage how close to the upper size limit the policy is, with 100% equaling the maximum allowed size.
"The fully qualified host component of the domain name of the identity provider.
Specify this value only for OAuth 2.0 access tokens. Currently www.amazon.com
and graph.facebook.com
are the only supported identity providers for OAuth 2.0 access tokens. Do not include URL schemes and port numbers.
Do not specify this value for OpenID Connect ID tokens.
"An identifier for the assumed role session. Typically, you pass the name or identifier that is associated with the user who is using your application. That way, the temporary security credentials that your application will use are associated with that user. This session name is included as part of the ARN and assumed role ID in the AssumedRoleUser
response element.
The regex used to validate this parameter is a string of characters consisting of upper- and lower-case alphanumeric characters with no spaces. You can also include underscores or any of the following characters: =,.@-
"AssumeRoleWithWebIdentity
call. "RoleSessionName
that you specified when you called AssumeRole
. "The temporary security credentials, which include an access key ID, a secret access key, and a security token.
Note: The size of the security token that STS APIs return is not fixed. We strongly recommend that you make no assumptions about the maximum size. As of this writing, the typical size is less than 4096 bytes, but that can vary. Also, future updates to AWS might require larger sizes.
"iss
field. For OAuth 2.0 access tokens, this contains the value of the ProviderId
parameter that was passed in the AssumeRoleWithWebIdentity
request."WebIdentityToken
that was submitted with the AssumeRoleWithWebIdentity
call. The identifier is typically unique to the user and the application that acquired the WebIdentityToken
(pairwise identifier). For OpenID Connect ID tokens, this field contains the value returned by the identity provider as the token's sub
(Subject) claim. "The name of the federated user. The name is used as an identifier for the temporary security credentials (such as Bob
). For example, you can reference the federated user name in a resource-based policy, such as in an Amazon S3 bucket policy.
The regex used to validate this parameter is a string of characters consisting of upper- and lower-case alphanumeric characters with no spaces. You can also include underscores or any of the following characters: =,.@-
"An IAM policy in JSON format that is passed with the GetFederationToken
call and evaluated along with the policy or policies that are attached to the IAM user whose credentials are used to call GetFederationToken
. The passed policy is used to scope down the permissions that are available to the IAM user, by allowing only a subset of the permissions that are granted to the IAM user. The passed policy cannot grant more permissions than those granted to the IAM user. The final permissions for the federated user are the most restrictive set based on the intersection of the passed policy and the IAM user policy.
If you do not pass a policy, the resulting temporary security credentials have no effective permissions. The only exception is when the temporary security credentials are used to access a resource that has a resource-based policy that specifically allows the federated user to access the resource.
The format for this parameter, as described by its regex pattern, is a string of characters up to 2048 characters in length. The characters can be any ASCII character from the space character to the end of the valid character list (\u0020-\u00FF). It can also include the tab (\u0009), linefeed (\u000A), and carriage return (\u000D) characters.
The policy plain text must be 2048 bytes or shorter. However, an internal conversion compresses it into a packed binary format with a separate limit. The PackedPolicySize response element indicates by percentage how close to the upper size limit the policy is, with 100% equaling the maximum allowed size.
For more information about how permissions work, see <a href="http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_getfederationtoken.html\">Permissions for GetFederationToken.
"The temporary security credentials, which include an access key ID, a secret access key, and a security (or session) token.
Note: The size of the security token that STS APIs return is not fixed. We strongly recommend that you make no assumptions about the maximum size. As of this writing, the typical size is less than 4096 bytes, but that can vary. Also, future updates to AWS might require larger sizes.
"arn:aws:sts::123456789012:federated-user/Bob
or 123456789012:Bob
). You can use the federated user's ARN in your resource-based policies, such as an Amazon S3 bucket policy. "The identification number of the MFA device that is associated with the IAM user who is making the GetSessionToken
call. Specify this value if the IAM user has a policy that requires MFA authentication. The value is either the serial number for a hardware device (such as GAHT12345678
) or an Amazon Resource Name (ARN) for a virtual device (such as arn:aws:iam::123456789012:mfa/user
). You can find the device for an IAM user by going to the AWS Management Console and viewing the user's security credentials.
The regex used to validated this parameter is a string of characters consisting of upper- and lower-case alphanumeric characters with no spaces. You can also include underscores or any of the following characters: =,.@:/-
"The value provided by the MFA device, if MFA is required. If any policy requires the IAM user to submit an MFA code, specify this value. If MFA authentication is required, and the user does not provide a code when requesting a set of temporary security credentials, the user will receive an "access denied" response when requesting resources that require MFA authentication.
The format for this parameter, as described by its regex pattern, is a sequence of six numeric digits.
"The temporary security credentials, which include an access key ID, a secret access key, and a security (or session) token.
Note: The size of the security token that STS APIs return is not fixed. We strongly recommend that you make no assumptions about the maximum size. As of this writing, the typical size is less than 4096 bytes, but that can vary. Also, future updates to AWS might require larger sizes.
"The identity provider (IdP) reported that authentication failed. This might be because the claim is invalid.
If this error is returned for the AssumeRoleWithWebIdentity
operation, it can also mean that the claim has expired or has been explicitly revoked.
DecodeAuthorizationMessage
was invalid. This can happen if the token contains invalid characters, such as linebreaks. ",0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node',
1 verbose cli '/usr/local/bin/npm',
1 verbose cli 'run',
1 verbose cli 'build:release' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'prebuild:release', 'build:release', 'postbuild:release' ]
5 info lifecycle [email protected]~prebuild:release: [email protected]
6 info lifecycle [email protected]~build:release: [email protected]
7 verbose lifecycle [email protected]~build:release: unsafe-perm in lifecycle true
8 verbose lifecycle [email protected]~build:release: PATH: /usr/local/lib/node_modules/npm/bin/node-gyp-bin:/Users/kerr/graphql-voyager-1.0.0-rc.7/node_modules/.bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
9 verbose lifecycle [email protected]~build:release: CWD: /Users/kerr/graphql-voyager-1.0.0-rc.7
10 silly lifecycle [email protected]~build:release: Args: [ '-c',
10 silly lifecycle 'npm run clean:release && NODE_ENV=production webpack --config build/webpack.js && rimraf dist/voyager.worker.js.map && npm run build:middleware' ]
11 silly lifecycle [email protected]~build:release: Returned: code: 2 signal: null
12 info lifecycle [email protected]~build:release: Failed to exec build:release script
13 verbose stack Error: [email protected] build:release: `npm run clean:release && NODE_ENV=production webpack --config build/webpack.js && rimraf dist/voyager.worker.js.map && npm run build:middleware`
13 verbose stack Exit status 2
13 verbose stack at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:280:16)
13 verbose stack at emitTwo (events.js:106:13)
13 verbose stack at EventEmitter.emit (events.js:191:7)
13 verbose stack at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack at emitTwo (events.js:106:13)
13 verbose stack at ChildProcess.emit (events.js:191:7)
13 verbose stack at maybeClose (internal/child_process.js:886:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
14 verbose pkgid [email protected]
15 verbose cwd /Users/kerr/graphql-voyager-1.0.0-rc.7
16 verbose Darwin 16.7.0
17 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "build:release"
18 verbose node v6.10.2
19 verbose npm v5.4.2
20 error code ELIFECYCLE
21 error errno 2
22 error [email protected] build:release: `npm run clean:release && NODE_ENV=production webpack --config build/webpack.js && rimraf dist/voyager.worker.js.map && npm run build:middleware`
22 error Exit status 2
23 error Failed at the [email protected] build:release script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 2, true ]
As Relay option...
Thanks!
I don't know exactly how to use the prebundled version, I tried the following so far
<!DOCTYPE html>
<html>
<head>
<script src="//cdn.jsdelivr.net/react/15.4.2/react.min.js"></script>
<script src="//cdn.jsdelivr.net/react/15.4.2/react-dom.min.js"></script>
<link rel="stylesheet" href="./node_modules/graphql-voyager/dist/voyager.css" />
<script src="./node_modules/graphql-voyager/dist/voyager.min.js"></script>
</head>
<body>
<div id="voyager">Loading...</div>
<script>
function introspectionProvider(introspectionQuery) {
// This example expects a GraphQL server at the path /graphql.
// Change this to point wherever you host your GraphQL server.
return fetch('http://127.0.0.1:8000/graphql', {
method: 'post',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json',
},
body: JSON.stringify({query: introspectionQuery}),
credentials: 'include',
}).then(function (response) {
return response.text();
}).then(function (responseBody) {
try {
return JSON.parse(responseBody);
} catch (error) {
return responseBody;
}
});
}
// Render <Voyager />
GraphQLVoyager.init(document.getElementById('voyager'), {
introspection: introspectionProvider
})
</script>
</body>
</html>
What else do I need to do, if I want to use only de CDNs
Amazing lib, great work.
It will be super great if we can have buttons like deploy to azure, deploy to heroku, deploy to xxx
Currently there is no way to change root of graph on pre-bundled version or am I wrong ?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.