{"componentChunkName":"component---src-templates-default-template-tsx","path":"/documentation/concepts/iam_hiro6/","result":{"data":{"asciidoc":{"id":"2be1888d-9072-5415-9d2b-4ddde17c60bf","html":"<div id=\"toc\" class=\"toc\">\n<div id=\"toctitle\">Table of Contents</div>\n<ul class=\"sectlevel1\">\n<li><a href=\"#_introduction\">Introduction</a></li>\n<li><a href=\"#_data_governance_method_in_hiro\">Data Governance Method in HIRO</a></li>\n<li><a href=\"#_data_access_control\">Data Access Control</a></li>\n<li><a href=\"#_access_token_for_non_ui_apps\">Access Token for Non-UI Apps</a></li>\n<li><a href=\"#_access_tokens_and_permissions_for_ui_apps\">Access Tokens and Permissions for UI Apps</a></li>\n<li><a href=\"#_websocket_connections_and_access_tokens\">Websocket connections and access tokens</a></li>\n<li><a href=\"#_ensuring_that_the_hiro_engine_can_access_data\">Ensuring that the HIRO™ Engine can access data</a></li>\n</ul>\n</div>\n<div class=\"sect1\">\n<h2 id=\"_introduction\">Introduction</h2>\n<div class=\"sectionbody\">\n<div class=\"paragraph\">\n<p>Any API request requires an access token from HIRO&#8482; and once the token is obtained, the HIRO&#8482; backend\nwill always check whether the token is valid or not, whether the API request is to be granted or\ndenied. The access token contains the details of the user and application that is accessing the API.</p>\n</div>\n<div class=\"paragraph\">\n<p>In HIRO, the <a href=\"/7.0/documentation/api/auth-api/\">Auth API</a> is used to obtain access tokens. When\na developer creates an application, the application needs to authenticate with the Auth API so that\nproper access can be granted to that application.</p>\n</div>\n<div class=\"paragraph\">\n<p>As explained in more detail in the Authentication article, HIRO provides 2 types of authentication flows:\n<em>password flow</em> and <em>UI flow</em>.</p>\n</div>\n</div>\n</div>\n<div class=\"sect1\">\n<h2 id=\"_data_governance_method_in_hiro\">Data Governance Method in HIRO</h2>\n<div class=\"sectionbody\">\n<div class=\"paragraph\">\n<p>In HIRO, data and access is governed by means of roles (or permission groups). Each account created will\nbe assigned to one or multiple roles. In HIRO, the creation of roles provides two purposes:</p>\n</div>\n<div class=\"olist arabic\">\n<ol class=\"arabic\">\n<li>\n<p>to grant permissions to access data</p>\n</li>\n<li>\n<p>to provide role-based control of available features and flows in the user interfaces.</p>\n</li>\n</ol>\n</div>\n<div class=\"paragraph\">\n<p>By default, for any HIRO customer there is always one role defined that represents the whole customer\norganization (e.g. <em>customer-domain.com</em>). Data owned by this organization-wide role is available to all\nmembers of the organization. Customers may partition their data into multiple roles, e.g. per division\nor team, if data access should be further restricted. For example, team-based roles might be called\n <em>it.customer-domain.com</em>, <em>hr.customer-domain.com</em>, and <em>finance.customer-domain.com</em>.</p>\n</div>\n<div class=\"paragraph\">\n<p>Users are also assigned IAM roles according to their user role in the HIRO user interface, i.e.:</p>\n</div>\n<div class=\"ulist\">\n<ul>\n<li>\n<p><strong>Knowledge Expert</strong>: <code>knowledge-expert</code></p>\n</li>\n<li>\n<p><strong>Subject Matter Expert (SME)</strong>: implicitly specified by absence of <code>knowledge-expert</code> role</p>\n</li>\n<li>\n<p><strong>Administrator</strong>: <code>org-admin</code></p>\n</li>\n</ul>\n</div>\n<div class=\"paragraph\">\n<p>As such, new user accounts are automatically assigned to the organization role (all members), and\nhave the SME role for the user interface, unless configured differently by the administrator.</p>\n</div>\n</div>\n</div>\n<div class=\"sect1\">\n<h2 id=\"_data_access_control\">Data Access Control</h2>\n<div class=\"sectionbody\">\n<div class=\"paragraph\">\n<p>Data access is determined on a per-vertex level in HIRO. In general, for most entity types the allowed\ndata access operations (whether creating, reading, updating or deleting) are determined by the vertex\nattibutes below:</p>\n</div>\n<div class=\"ulist\">\n<ul>\n<li>\n<p><strong>ogit/_owner=&lt;account_or_role&gt;</strong> \t: For the data to be shared (read and write)</p>\n</li>\n<li>\n<p><strong>ogit/_reader=&lt;account_or_role&gt;</strong>\t: For data to be shared (read only)</p>\n</li>\n</ul>\n</div>\n<div class=\"paragraph\">\n<p>If the <code>ogit/_owner</code> attribute of a vertex contains a specific account name, only this user has read/write\naccess to this vertex. Be careful when you want to restrict data access to a single user account.\nTypically, the <code>ogit/_owner</code> attribute is set to a data access role of the whole organisation or a team\n(see above). In this case, any account that is assigned the role specified in the owner attribute will\nhave read/write access to that vertex. This user can modify the vertex and even delete the vertex.</p>\n</div>\n<div class=\"paragraph\">\n<p>In the same way, any account associated with the role specified in the <code>ogit/_reader</code> attribute will\nhave read permission for that vertex.</p>\n</div>\n<div class=\"paragraph\">\n<p><strong>Attention</strong>: By default, if a vertex is created without specifying the <code>ogit/_owner</code> attribute, the owner\nwill be set to the account id of the creator, and the vertex will be accessible only to this user. Ensure\nthat you set the owner attribute correctly if you want other users (and the HIRO Engine!) to see the data.</p>\n</div>\n</div>\n</div>\n<div class=\"sect1\">\n<h2 id=\"_access_token_for_non_ui_apps\">Access Token for Non-UI Apps</h2>\n<div class=\"sectionbody\">\n<div class=\"paragraph\">\n<p>Each application using the HIRO API needs to be registered and gets assigned an application key, consisting\nof client_ID and client_secret. This means that the username and password are used to identify and\nauthenticate the user, while the application key  (consisting of client_ID and client_secret) is used to\nidentify the application.\nDuring the authentication flow, the application passes along the application key together with the user\ncredentials, and access tokens are always issued for the specific combination of user and application.</p>\n</div>\n<div class=\"paragraph\">\n<p>By design, access tokens will expire after a few hours. If the access token is expired, HIRO will return\nthe proper response (e.g. HTTP status code 401) to the application and the application must retrigger the\npassword flow in to receive the access token.</p>\n</div>\n<div class=\"paragraph\">\n<p>The HIRO libraries for Java and Javascript handle most token related operations internally when the\nproper settings are initialized.</p>\n</div>\n<div class=\"paragraph\">\n<p>An example for non-UI applications are Connectors. Connectors transfer data from a customer’s existing\nsystem to HIRO. Connectors are normally run as a backend service without dedicated user interface.</p>\n</div>\n<div class=\"paragraph\">\n<p>The app identifiers (client_id and client_secret) will be provided and used for all API\ninteractions of the connector. As a best practice, a separate service user account should be registered\nfor each connector, so that the origin of data can be traced.</p>\n</div>\n</div>\n</div>\n<div class=\"sect1\">\n<h2 id=\"_access_tokens_and_permissions_for_ui_apps\">Access Tokens and Permissions for UI Apps</h2>\n<div class=\"sectionbody\">\n<div class=\"paragraph\">\n<p>The HIRO Desktop framework provides an infrastructure to host different browser\napplications on the platform. So the web applications are hosted on the HIRO &#8482;\nSaaS Cloud and are delivered to the user&#8217;s web browser. The HIRO Desktop framework\nalso takes care of listing and launching the available apps, handling the user\nlogin flows, and managing user sessions.\nBy running the UI applications inside the HIRO Desktop framework, access tokens\nare fully-handled by the framework, which means that developers do not have to\nmanage the access tokens.</p>\n</div>\n<div class=\"paragraph\">\n<p>However, as a UI app developer, you need to take care of data access permissions by\nsetting the data owner (and reader) correctly when a vertex is created by the\napplication. An example would be when a HIRO Desktop application has an input\nform for a user to enter data into HIRO. The application needs to ensure to set\nthe <code>ogit/_owner</code> attribute on the new vertices correctly to the data access role\n(permission group) that should have read/write permissions.</p>\n</div>\n<div class=\"paragraph\">\n<p>When designing a new applications, the developer needs to consider and plan the\nintended data access permissions, and then implement it consistently.</p>\n</div>\n<div class=\"paragraph\">\n<p>Head over to <a href=\"/7.0/documentation/api/auth-api/\">HIRO Auth API</a> for examples on how to get a token.</p>\n</div>\n</div>\n</div>\n<div class=\"sect1\">\n<h2 id=\"_websocket_connections_and_access_tokens\">Websocket connections and access tokens</h2>\n<div class=\"sectionbody\">\n<div class=\"paragraph\">\n<p>In most cases, when developing Connectors, the Graph REST API will be used.\nHowever, there are also other types of APIs that can be utilised, i.e. the Websocket API\nand Event Stream. For Websocket API and Event Stream, a special handling of\naccess tokens and token refresh is required. Websocket connections may stay active\nlonger than the token lifetime. Therefore, the Websocket API supports a mechanism\nto refresh expired tokens.</p>\n</div>\n<div class=\"paragraph\">\n<p>For more information on the access token for Websocket API and Event Stream,\nplease refer to the <a href=\"/7.0/documentation/api/ws-api/\">HIRO Websocket API Reference</a>.</p>\n</div>\n</div>\n</div>\n<div class=\"sect1\">\n<h2 id=\"_ensuring_that_the_hiro_engine_can_access_data\">Ensuring that the HIRO™ Engine can access data</h2>\n<div class=\"sectionbody\">\n<div class=\"paragraph\">\n<p>When data is injected to HIRO&#8482; by Connectors, this data should typically be\nprocessed by the HIRO&#8482; Engine for automation of tasks. Hence, to ensure that\nthe HIRO&#8482; Engine can access and work with the data injected by the Connector,\nit is important to set the <code>ogit/<em>owner</code> attribute correctly when creating the\nvertices. As long as there are no special data access requirements, it is a good\npractice to set the the <code>ogit/_owner</code> field to the data access role of the\ncompany (e.g. _customer-domain.com</em>). This will ensure that the HIRO&#8482; Engine can\nprocess the data, and that your end users can view the data in the HIRO&#8482; frontend.</p>\n</div>\n</div>\n</div>","document":{"main":"Identity and Access Management in HIRO 6","title":"Identity and Access Management in HIRO 6","subtitle":""},"fields":{"toc":true,"location":["documentation","concepts","iam_hiro6"]}},"sidebarYaml":{"id":"6d066bdd-c982-5a69-b909-a31e6fc044e0","showIndex":null}},"pageContext":{"id":"2be1888d-9072-5415-9d2b-4ddde17c60bf","parent":"documentation"}},"staticQueryHashes":["1010459453","1010459453","2356112386","2356112386","2603905930","2603905930","3026652197","3026652197","3167850324","3167850324","63159454","63159454"]}