Cancel
Showing results for 
Search instead for 
Did you mean: 

ITK_Autologin()- Invalid credentials

Pioneer
Pioneer

ITK Program...

 

I have written a itk program to create item in teamcenter. I used autologin function to login into teamcenter. My os username is not a part of teamcenter user. it should print not success ful line. but whenever i run the program it does not give me the not succesful output. The console says enter username and password...How do i get login unsuccessful line in my console.

 

 

#include <stdlib.h>
#include <tc/tc.h>
#include <sa/tcfile.h>
#include <tccore/item.h>
#include <tc/folder.h>
#include <tccore/workspaceobject.h>
#include <ae/ae.h>
 
#define EXIT_FAILURE 1
 
static void create_item (char *item_id, char *item_name, tag_t *new_item, tag_t *new_rev)
{
    //char item_name[30];  
char type_name[ITEM_type_size_c + 1] = {""}, rev_id[] = "A";
       
    strcpy(item_name,item_id);
    printf("Creating Item ID: %s\n", item_id);
    ITEM_create_item( item_id, item_name, type_name, rev_id, new_item, new_rev);
 
    printf("Saving Item ID: %s\n", item_id);
    ITEM_save_item(*new_item);
 
   
}
static void do_it(void)
{
    char   item_id[30] ;
char item_name[30];
    tag_t  new_item, new_rev, dataset;
         
    printf("Enter new Item ID: ");
    gets(item_id);
printf("Enter Item name: ");
    gets(item_name);
create_item(item_id,item_name, &new_item, &new_rev);
}
 
 
int ITK_user_main(int argc, char* argv[])
{
    int status = 0;
    char *message;
   
    ITK_initialize_text_services( 0 );
    status = ITK_auto_login();
  
    if (  (status != ITK_ok))
 {
  printf(" login NOT successful.\n");
 }
    else
    {
        printf("login successful.\n");
        ITK_set_journalling(TRUE);
        do_it();
    }
 
    ITK_exit_module(TRUE);
    return status;
}
1 REPLY

Re: ITK_Autologin()- Invalid credentials

Solution Partner Phenom Solution Partner Phenom
Solution Partner Phenom

Hello,

 

In your environment, what is the value set for TC_auto_login preference?

 

Harish